diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 07:23:58 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | a63185292e80beac3848f4f6395c61d941f5144f (patch) | |
| tree | e097eb6675db1af9a098e647a5b9f33c161c7ba4 /test/panes.zig | |
| parent | 97780909cbe0f4c62dfb9b012bff3fe7e7ec32f9 (diff) | |
| download | pardes-a63185292e80beac3848f4f6395c61d941f5144f.tar.gz pardes-a63185292e80beac3848f4f6395c61d941f5144f.zip | |
A look that goes to another pane leaves the looking pane's dot alone
Every look that found something cleared the looker's selection first, so
`@p5:2` or `f.txt:2` written to a pane's look collapsed its dot to
q1-1. Only a look that stays in the pane starts from a clean selection
now; one that goes elsewhere takes away just the click's highlight, and a
miss changes nothing, as acme's look does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/panes.zig')
| -rw-r--r-- | test/panes.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/panes.zig b/test/panes.zig index 42dd6b77..3d2821aa 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -4853,7 +4853,7 @@ const LookResetTests = struct { try std.testing.expectEqualStrings("needle", selected(pane)); } - test "Look clears both source and existing destination selections before focus" { + test "Look clears the source's click highlight, not its dot, and the destination's selections before focus" { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 30 }); defer p.deinit(); const source = try p.setTestFile("source\nlines\n"); @@ -4872,9 +4872,12 @@ const LookResetTests = struct { try seed(destination, "previous destination"); pardes.look.lookAt(p, 0, source.pointer_selections[0].?.raw_text.?); try std.testing.expectEqual(id, p.active); - try cleared(source); + // The source keeps its dot (acme's look leaves it); the click's + // highlight goes. + for (source.sel) |selection| try std.testing.expectEqual(.none, selection.state); + for (source.pointer_selections) |selection| try std.testing.expect(selection == null); + try std.testing.expect(source.body.vsel.active); try cleared(destination); - try std.testing.expect(!source.body.vsel.active); if (range) { try std.testing.expectEqual(@as(i32, 1), destination.body.cur_row); try std.testing.expectEqualStrings("rav", selected(destination)); |
