diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 00:54:58 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | e988d4e24bfc0b80285754359b4b86f1b15b33f6 (patch) | |
| tree | 7a0e62703f7da558e8695bcf5e2432ff1e52a464 /test | |
| parent | 7aa057e29b729ad6d9ac53e3a06f99858fc449e4 (diff) | |
| download | pardes-e988d4e24bfc0b80285754359b4b86f1b15b33f6.tar.gz pardes-e988d4e24bfc0b80285754359b4b86f1b15b33f6.zip | |
Restore keeps each pane's dot, as acme's dump does
A restored text pane came back with its caret at its view's top, whatever
had been selected. The dump now keeps each text pane's dot, q0 and q1 as
acme's keeps a window's, and Restore puts it back without moving the view
it kept. Two look-walk tests that restored and walked on now start from the
match they were on.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/output.zig | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/output.zig b/test/output.zig index e49ec4ff..95cdbfb7 100644 --- a/test/output.zig +++ b/test/output.zig @@ -799,13 +799,16 @@ test "n/N skips formatted context and selects comment match locations" { defer restored.deinit(); pardes.look.armLookWalk(restored, id); const restored_result = restored.panes[id].?; - restored.update(.{ .key = .{ .cp = 'n' } }); + // The dot came back on the match it was on (the first), so the + // walk goes on from there. try std.testing.expectEqual(@as(i32, @intCast(matches[0])), restored_result.body.cur_row); - restored.update(.{ .key = .{ .cp = 'N' } }); + restored.update(.{ .key = .{ .cp = 'n' } }); try std.testing.expectEqual(@as(i32, @intCast(matches[1])), restored_result.body.cur_row); + restored.update(.{ .key = .{ .cp = 'N' } }); + try std.testing.expectEqual(@as(i32, @intCast(matches[0])), restored_result.body.cur_row); const restored_file = &restored_result.file.?; - const last = modal.lineSlice(restored_file.content, matches[1]); - try std.testing.expectEqualStrings(last[0..restored_file.location_rows[matches[1]].location_end], selectedOutputText(restored_result) orelse ""); + const last = modal.lineSlice(restored_file.content, matches[0]); + try std.testing.expectEqualStrings(last[0..restored_file.location_rows[matches[0]].location_end], selectedOutputText(restored_result) orelse ""); } } } @@ -1587,7 +1590,9 @@ test "stacked search and LSP results retain source tint navigation and dump owne } restored.active = id; pardes.look.armLookWalk(restored, id); - restored.update(.{ .key = .{ .cp = 'N' } }); + // The dot came back on the match it was on; the walk goes on. + try std.testing.expectEqual(@as(i32, @intCast(matches[0])), restored.panes[id].?.body.cur_row); + restored.update(.{ .key = .{ .cp = 'n' } }); try std.testing.expectEqual(@as(i32, @intCast(matches[1])), restored.panes[id].?.body.cur_row); try std.testing.expectEqualStrings(source_text, source.file.?.content); } |
