summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-21 21:05:10 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commit2b0d9d607094739133470c10af51fd670cd63ed3 (patch)
treefba9307729212551e5cecc8fda4671a0b0de9cde /src/pardes.zig
parent15325f929c0c25e97ee98aaa613808661a864e1d (diff)
downloadpardes-2b0d9d607094739133470c10af51fd670cd63ed3.tar.gz
pardes-2b0d9d607094739133470c10af51fd670cd63ed3.zip
A drag started on a file's line numbers copies only the text
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 7e166847..2a94c0f0 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -9001,6 +9001,19 @@ test "board heap: every allocation failure during boot is a clean OutOfMemory" {
);
}
+test "a sweep pressed on the line numbers copies only the text" {
+ const p = try Pardes.init(std.testing.allocator, .{ .cols = 60, .rows = 12 });
+ defer p.deinit();
+ const pane = try p.setTestFile("alpha beta\ngamma delta\n");
+ const numbers: i32 = panes.File.gutterWidth(pane);
+ const top: i32 = pane.tag_rows;
+ pane.sel[0] = .{ .state = .done, .c0 = 1, .c1 = numbers + 4, .r0 = top, .r1 = top + 1 };
+ // Live, while the drag is held, and captured, once it is released.
+ try std.testing.expectEqualStrings("alpha beta\ngamma", try edit.selectionText(p, pane, pane.sel[0]));
+ try edit.capturePointerSelection(p, pane, 0);
+ try std.testing.expectEqualStrings("alpha beta\ngamma", try edit.selectionText(p, pane, pane.sel[0]));
+}
+
test "jump history clears selections and lands at the recorded cursor" {
const p = try Pardes.init(std.testing.allocator, .{ .cols = 60, .rows = 12 });
defer p.deinit();