summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
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();