summaryrefslogtreecommitdiff
path: root/core/Query.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 00:44:54 -0300
committerGabriel Schneider <[email protected]>2026-11-25 01:05:40 -0300
commit32f8f603f30a6e6e196da929fa0df82b8e94f4c1 (patch)
treeed2a839e5aa06da9bd540cb1d9b46b165353fa43 /core/Query.zig
parentab4e13779ccda0ac5ce497fd2b706930e2f2845c (diff)
downloadpardes-32f8f603f30a6e6e196da929fa0df82b8e94f4c1.tar.gz
pardes-32f8f603f30a6e6e196da929fa0df82b8e94f4c1.zip
Prompt, Pick: lines D's pickers and E's prompts work together where jumps walk (walk UI M3 item 2, pick-ui SPEC §7.2, §6.3, §7.3): Alt-Enter in a search (`/ ?`) or a sam prompt (`s S K A-K`) keeps the result as a list, a row a place (`path:line:col: text`, the text's leading blanks off, cut to 160 bytes, look.parsePathLine's form so the column lands too), the first Query.max_rows (2000) and a message saying how many there were past it: where jumps walk (Pick.asked: never a 9P script's) a picker of those rows (Pick.Source.list, titled by the prompt's plain word, `/dirty/` or `Edit x/dirty/`, cut to the picker's word at a character's start) in the tag of the pane its Enter lands in, the body as it was before the prompt, its Enter the list word `/dirty/ 3/7` in the trail; under `Jumps new-pane` a search keeps E's query pane (Query.open) and a sam prompt's selections are a +Search list (Output.fillResults), where before Alt-Enter in a sam prompt did nothing; the sam prompts' hints say `M-⏎ as a list` as the search's do; one owner for n and N (§6.3: the newest list or search word, or the one Looked at): a search's places answer n while they light its word (§7.3: tinted while it is the word n walks), so a list landed in the pane (Pick.listed, after Trail.through) puts a search's tints out, n then walking the list (D's walkList already gives way to a newer search word), and Look on the search word (Prompt.lookWord) lights it and takes n back; F's colors.previewTheme stays the one theme preview (no other in the tree; it is derived each step from the live themes picker, Pick.produceAll, so E2's `:theme ` either goes through Pick.Source.themes or derives it the same way); TEST FIRST: Prompt.zig "Alt-Enter in / or s keeps the result as a list ..." (failed before: no picker, Pick.live null), Pick.zig "n and N walk the newest list or search word, or the one Looked at ..." (failed before: the search's places still lit after the list landed, Pick.zig:1912, n stepping the search); E's `?` test loses its Alt-Enter tail (now in the new test, both routings), its `s` head test reads the new hint; five Query/Stream tests about today's query pane opened by Alt-Enter in `/` set `Jumps new-pane` (G's newpane.py); goldens: selregex and msg regenerated (process-test --update), each changed row the sam prompt's hint `⏎ select · M-⏎ as a list · C-r history · esc` and nothing else; tui core-test 1053/1223 (170 skipped, 0 failed); process-test 9 of 146 failed before the two updates: those two and item 1's seven left to item 3
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/Query.zig')
-rw-r--r--core/Query.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/Query.zig b/core/Query.zig
index a090929a..e64f5b89 100644
--- a/core/Query.zig
+++ b/core/Query.zig
@@ -2179,6 +2179,8 @@ test "parse: line 1's first word names the source" {
test "a / query: keystroke by keystroke, the owner shows the set, rows from its own rows alone, zero hits a state, Esc puts all back" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 });
defer p.deinit();
+ // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6).
+ p.settings.jumps = .@"new-pane";
const pane = try p.setTestFile("alpha one\nbeta\nalphabet\ngamma alpha\nalpha two\ndelta\n");
p.newScratchBelow(0);
const below = p.view().cols[0].panes[1];
@@ -2244,6 +2246,8 @@ test "a / query: keystroke by keystroke, the owner shows the set, rows from its
test "a dump holding a query pane, live or frozen, restores it as it was" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 });
defer p.deinit();
+ // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6).
+ p.settings.jumps = .@"new-pane";
_ = try p.setTestFile("alpha one\nbeta\nalphabet\n");
slash(p, "/alpha");
for (0..2) |_| {
@@ -2263,6 +2267,8 @@ test "a dump holding a query pane, live or frozen, restores it as it was" {
test "a / query: Enter lands and freezes, the register filled, n and N step silently, a later / reuses the pane and Esc brings the frozen rows back" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 });
defer p.deinit();
+ // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6).
+ p.settings.jumps = .@"new-pane";
const pane = try p.setTestFile("alpha one\nbeta\nalphabet\ngamma alpha\nalpha two\ndelta\n");
slash(p, "/alpha");
const qid = queryPane(p).?;
@@ -2536,6 +2542,8 @@ test "a language server's list: one answer lands with no pane, several open the
test "B1 on a query pane's rows places the caret and selects, nothing else, the current row's mark kept; j, k and n make a row current, Enter lands the current" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 });
defer p.deinit();
+ // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6).
+ p.settings.jumps = .@"new-pane";
const pane = try p.setTestFile("alpha one\nbeta\nalphabet\ngamma alpha\nalpha two\ndelta\n");
slash(p, "/alpha");
const qid = queryPane(p).?;