summaryrefslogtreecommitdiff
path: root/core/Prompt.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 00:52:21 -0300
committerGabriel Schneider <[email protected]>2026-11-25 00:52:21 -0300
commitc9a5d230570863beb8183190d01c7e19c7696a14 (patch)
tree820e6d227dbc49b96850b664704553393129f899 /core/Prompt.zig
parentac450e5868f528b312abb2b46191cd8bce5bff3d (diff)
downloadpardes-c9a5d230570863beb8183190d01c7e19c7696a14.tar.gz
pardes-c9a5d230570863beb8183190d01c7e19c7696a14.zip
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 <[email protected]>
Diffstat (limited to 'core/Prompt.zig')
-rw-r--r--core/Prompt.zig7
1 files changed, 6 insertions, 1 deletions
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| {