diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-24 14:16:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-24 14:26:04 -0300 |
| commit | f3b5bd10ceb4c4db7263739770d5e4bdb879ba75 (patch) | |
| tree | 39cbb04a514650f3453bfb0df3acb291d913f53d /src/Query.zig | |
| parent | 9299281492d63e549ab274034efb59ab4e9d96f6 (diff) | |
| download | pardes-f3b5bd10ceb4c4db7263739770d5e4bdb879ba75.tar.gz pardes-f3b5bd10ceb4c4db7263739770d5e4bdb879ba75.zip | |
Search converge 7/6: a script's Grep or Find that misses opens nothing, a dumped query pane restores as plain text; fs.py's Recent and canary to the query pane
Diffstat (limited to 'src/Query.zig')
| -rw-r--r-- | src/Query.zig | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Query.zig b/src/Query.zig index 6374ce42..a871b71e 100644 --- a/src/Query.zig +++ b/src/Query.zig @@ -1998,6 +1998,24 @@ test "a / query: keystroke by keystroke, the owner shows the set, rows from its try std.testing.expectEqual(@as(i32, 2), pane.body.cur_row); } +test "a dump holding a query pane, live or frozen, restores, the pane as plain text" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 }); + defer p.deinit(); + _ = try p.setTestFile("alpha one\nbeta\nalphabet\n"); + typeKeys(p, "/alpha"); + for (0..2) |_| { + const qid = queryPane(p).?; + try pardes.dump.dumpState(p); + const restored = try pardes.dump.initFromDump(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 }, p.dump_out.?); + defer restored.deinit(); + const back = restored.panes[qid].?; + try std.testing.expect(back.query == null); + try std.testing.expectEqual(@as(usize, 0), back.file.?.location_rows.len); + try std.testing.expect(std.mem.startsWith(u8, back.file.?.content, "/alpha\n")); + p.update(.{ .key = .{ .cp = Key.enter } }); + } +} + 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(); |
