From c9a5d230570863beb8183190d01c7e19c7696a14 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 25 Nov 2026 00:52:21 -0300 Subject: Prompt: `:` has a history of its own, Up and Down recalling the lines its Enter ran and C-r unrolling them before its rows (walk UI, pick-ui SPEC.md §7.2 and §8, item 3 of line E2): Up and Down bring `:`'s ring's lines into the field (Pardes.prompt_history.command, 16 lines, newest first; the search and select prompts' and the pipes' are their own), its rows made again for the line recalled (`set Wrap off` lists Wrap's values); Ctrl-r unrolls the ring as a step, the lines holding the field, now the band's FIRST step for `:` (Prompt.steps): after the rows and their doc it was placed past the doc, which takes the width the others leave, so it was never seen; `:` on the empty field gives the keyboard to the tag's own text and `:` there gives it back (item 1); Esc in a tag keeps today's meaning (Last), as four tests pin it; TEST FIRST: Command.zig ": has a history of its own: Up and Down bring back the lines Enter ran, newest first; C-r unrolls them beside the rows, filtered by the field; a search's lines are not among them" (on item 2: the band's first step was the rows, `Save in the tag` where `goto 2` was looked for); core-test 1023/1190 (167 skipped) Co-Authored-By: Claude Opus 5.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Prompt.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core/Prompt.zig') diff --git a/core/Prompt.zig b/core/Prompt.zig index 20c393bb..3dc13e1f 100644 --- a/core/Prompt.zig +++ b/core/Prompt.zig @@ -1145,7 +1145,12 @@ fn historyRows(p: *Pardes) u16 { pub fn steps(p: *Pardes, arena: std.mem.Allocator, out: *[Band.max_steps]Band.Step) ![]Band.Step { const s = &p.view().tag_state; var made: usize = 0; - if (s.prompt.op == .command) made = try Command.steps(p, arena, out); + // `:`'s history before its rows and their doc, which takes the width + // left after the others. + if (s.prompt.op == .command) { + if (s.prompt.history) made = try historyStep(p, arena, &out[0]); + return out[0 .. made + try Command.steps(p, arena, out[made..])]; + } if (s.prompt.op == .pipe_to) if (p.panes[TagState.hostOf(p) orelse return out[0..0]]) |pane| if (answered(p, pane, s.field.text())) |l| { var rows: std.ArrayList(Band.Row) = .empty; for (l.outs, l.codes, 0..) |o, c, i| { -- cgit v1.3