From ab806dc38ddcd74958b999fe708ae9ea63609f72 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 18:56:04 -0300 Subject: A mouse sweep selects a stream, as acme's does, not a rectangle A B1, B2 or B3 drag over several lines took the same columns from every row, a block. acme's sweep is a stream (libframe/frselect.c:115-140, frselectpaint; acme text.c:881, textselect): the first row from the press to its end, the rows between whole, the last from its start to the release. edit.sweepCols says which columns of a row a sweep takes; the captured spans, the text a sweep yields (copy, chords, B2 and B3 operands, a terminal's automatic yank) and the highlight all follow it, in bodies, multi-row tags, terminals and text-rendered PDFs; a row the sweep runs through is highlighted to the edge, and rows after the first leave out the line numbers. Native PDF selection was already MuPDF's stream. No pane keeps a rectangle. exec-bigdrag's golden changes: its middle sweep now runs whole lines. Co-Authored-By: Claude Opus 5.5 --- src/panes.zig | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/panes.zig') diff --git a/src/panes.zig b/src/panes.zig index a7e5c668..e4621311 100644 --- a/src/panes.zig +++ b/src/panes.zig @@ -27,8 +27,10 @@ pub const Pane = struct { /// The words that throw unsaved text away (builtins.zig warnModified). pub const Discarding = enum { Exit, Restore, get }; - /// One mouse selection (block-shaped), per button. c/r are text-area relative; - /// r counts from the tag's first row (the body starts at Pane.tag_rows). + /// One mouse sweep, per button: the press (c0, r0) and where it is now + /// (c1, r1), a stream between them as acme's (edit.sweepCols). c/r are + /// text-area relative; r counts from the tag's first row (the body + /// starts at Pane.tag_rows). pub const Sel = struct { state: enum { none, dragging, done } = .none, source_id: u64 = 0, @@ -38,12 +40,15 @@ pub const Pane = struct { r1: i32 = 0, }; - /// A rectangle keeps one source span per rendered row. Wrapped segments - /// remain separate rows when copied, even when they share a source line. + /// A captured sweep keeps one source span per rendered row. Wrapped + /// segments remain separate rows when copied, even when they share a + /// source line. pub const PointerRow = struct { row: i32, lo: usize, hi: usize, + /// Not the sweep's last row: its highlight runs to the right edge. + to_edge: bool = false, prefix: [32]u8 = @splat(0), prefix_len: u8 = 0, raw_terminal: bool = false, -- cgit v1.3