summaryrefslogtreecommitdiff
path: root/core/Query.zig
diff options
context:
space:
mode:
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");