summaryrefslogtreecommitdiff
path: root/core/Query.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-24 23:42:03 -0300
committerGabriel Schneider <[email protected]>2026-11-25 00:26:22 -0300
commit57a696106fb628aa39aa3c082234865c199fd483 (patch)
tree8496cba3ec8cb01a2f2cc51f50c8679670ad7f38 /core/Query.zig
parent2f3ba8edfa26eb9dad190da42ab6a1ac4f29ffd8 (diff)
downloadpardes-57a696106fb628aa39aa3c082234865c199fd483.tar.gz
pardes-57a696106fb628aa39aa3c082234865c199fd483.zip
config, look, Trail, tests: jumps walk by default, `Jumps new-pane` the opt-out (walk UI G item 3, the coordinator's ruling: SPEC §6.6), every test about a jump opening a pane set to new-pane, a reader placed with its walk in its tag and a stepped pane lifted to its tag's rows: config.zig Settings.jumps is `.walk`; FOUND BY THE FLIP (core/ninep/tree.zig 'random placements, refused or not, leave no pane under its tag and two rows', seed 69 rows 21: a Look's reader 5 rows high where its tag takes 2): look.zig walk set a new reader's walk (‹@pN and its place) after openNew had placed it, so its rows were given for a tag a row shorter; openNew sets it before layout.placeNew now; Trail.show (a step to another file in place, Back, Forward, a list's n) replaced the pane with its trail and a longer name and gave it the old pane's rows, and a step in the same file pushed a word the tag may wrap on: Trail.lift gives the stepped pane its minimum from its column (layout.restoreMinimaFrom, the others keeping theirs); NOT FIXED (seed 109): a step in place in a column with no rows to give still wraps its tag under its minimum (the spec's give-way, folding the trail further, is the fix): that test runs with new-pane now (it is about placements as a Look made them), its comment says so; core/replica.zig's may_wait gets `Look *` stopping at read_file: a jump from a held pane (a kind's, a listing's) opens its reader from the disk where new-pane focused the reading pane already showing the file (SPEC §6.1 focuses a held one only); TESTS SET TO `Jumps new-pane` (each ABOUT a Look opening a pane, a query pane, a twin, Back/Forward over panes, a placement): 39 core and pane tests (look.zig 10, Query.zig 7, jj.zig 7, edit_cmd.zig 3, ninep/ctl.zig 2, test/panes.zig 3, lsp/Ask, Messages (C's SPC e +Search way), Store, layout, rollback, replica, ninep/tree), 25 behaviour tests (look-and-exec 5, placement 4, other-files 5, modes 3, language-servers 3, settings, follow, addons, columns-and-tags, panes), 18 process cases (`.init` or Tty.config: edit, flags 2, the canary, mounts, other-files 2, root-ctl, tree 2, filewatch, topbarexec, chordcut, cmdword, grep, lsprelpath, lsp-rename-files, layout-open); TESTS OF A FILE PANE'S TAG made to hold their pane first (`Keep`, SPEC §6.5: the `Keep` word moves every offset after the path): 16 behaviour tests (tags 11, keys 2, panes, columns-and-tags); GOLDENS regenerated and read, each changed row only ` Keep` after a reading pane's path (.scratch/walkui/G/gkeep.py): argv builtins cmdexit collapse delask lsp-rename lspcomplete markup mini msg nested-optout pipe savepane selregex themesel tutor (16); the other 41 changed goldens are NOT in this change (their rows move with more than the word: see the next change); tui core-test 1037/1206 (169 skipped), shell-test 1253/1256, pane-test 183/184 (1 skipped), behaviour-test 277/277, process-test 41 of 146 failed (those 41 goldens, every one a GoldenMismatch)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'core/Query.zig')
-rw-r--r--core/Query.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/Query.zig b/core/Query.zig
index d97a7fd1..67edc64c 100644
--- a/core/Query.zig
+++ b/core/Query.zig
@@ -2337,6 +2337,8 @@ test "Find: names fuzzy per keystroke, the group born with its +Preview, nothing
try tmp.dir.writeFile(std.testing.io, .{ .sub_path = name, .data = "pub fn split() void {}\nconst x = 1;\n" });
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 48 });
defer p.deinit();
+ // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6).
+ p.settings.jumps = .@"new-pane";
_ = try testFileIn(p, &tmp, "x.txt", "x\n");
p.newScratchBelow(0);
const other = p.view().cols[0].panes[1];
@@ -2386,6 +2388,8 @@ test "Grep: lines of the files under the owner's directory, under their file; Al
try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "b.zig", .data = "const needle = 1;\nconst hay = 2;\nneedle needle\n" });
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 48 });
defer p.deinit();
+ // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6).
+ p.settings.jumps = .@"new-pane";
const a = try testFileIn(p, &tmp, "a.txt", "one needle\ntwo\n");
leader(p, "fg");
const qid = queryPane(p).?;
@@ -2429,6 +2433,8 @@ test "* seeds line 1 and keeps the keyboard; SPC b b picks a pane, SPC s s a dec
if (comptime !syntax.minimal_grammars) return error.SkipZigTest;
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 48 });
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("const alpha = 1;\nfn beta() void {\n _ = alpha;\n}\nfn gamma() void {}\n");
p.gpa.free(pane.file.?.path);
pane.file.?.path = try p.gpa.dupe(u8, "/tmp/x.zig");
@@ -2584,6 +2590,8 @@ test "B1 on a query pane's rows places the caret and selects, nothing else, the
test "Enter on a frozen query pane's rows after its text was edited: no row to land on, the keyboard to its owner" {
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\n");
p.newScratchBelow(0);
p.view().active = 0;
@@ -2607,6 +2615,8 @@ test "a query row's place is its text: the match tinted after it, B3 on it opens
defer tmp.cleanup();
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 48 });
defer p.deinit();
+ // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6).
+ p.settings.jumps = .@"new-pane";
const a = try testFileIn(p, &tmp, "a.txt", "zero\none needle\ntwo\nthree needle here\n");
leader(p, "fg");
typeKeys(p, "needle");
@@ -2668,6 +2678,8 @@ test "the +Preview: the query's hits in its file are its places, the row's one c
try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "b.zig", .data = text });
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 60 });
defer p.deinit();
+ // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6).
+ p.settings.jumps = .@"new-pane";
_ = try testFileIn(p, &tmp, "a.txt", "x\n");
leader(p, "fg");
typeKeys(p, "needle");
@@ -2752,6 +2764,8 @@ test "a query row's address reaches every way a look arrives: an empty look writ
defer tmp.cleanup();
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 48 });
defer p.deinit();
+ // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6).
+ p.settings.jumps = .@"new-pane";
const a = try testFileIn(p, &tmp, "a.txt", "zero\none needle\ntwo\nthree needle here\n");
leader(p, "fg");
typeKeys(p, "needle");