diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 00:35:15 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 01:17:28 -0300 |
| commit | d5158f6a69ce5a1af6372c140b07379ee0ba2446 (patch) | |
| tree | ec722719840f59263e4b7dbc740681594b526274 /src/mouse.zig | |
| parent | 3b31e0484bd06658f10cd9165b76cb1ca3b198bd (diff) | |
| download | pardes-d5158f6a69ce5a1af6372c140b07379ee0ba2446.tar.gz pardes-d5158f6a69ce5a1af6372c140b07379ee0ba2446.zip | |
Text, edit, normal, look, Query and their readers: the second selection form msel (whole rows r0..r1, for search-result highlights) goes; a visited search result and a query preview's place line are an explicit vsel like any other, back from the line's end (to the result's location start, the line's start for ordinary path:line rows; to the start for a preview line), and every msel branch in the edit ops, the drawing, the terminal's position tracking and the chords goes (visible: the result's highlight covers its line's characters and newline cell instead of the whole row width, with the ordinary selection colours; y, d and c on it act on that range as after x, its newline included, so a yanked result pastes as a line); selections.md and the ; Alt-; X Alt-x rows of helix-keys.md no longer describe msel; Text's walked shape changes (wire semantics)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/mouse.zig')
| -rw-r--r-- | src/mouse.zig | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/mouse.zig b/src/mouse.zig index 69d1456e..32f7c716 100644 --- a/src/mouse.zig +++ b/src/mouse.zig @@ -807,7 +807,6 @@ pub fn handleMouse(p: *Pardes, event: Mouse) void { pane.tag.mode = .normal; pane.tag.normal.clear(); pane.tag.vsel.active = false; - pane.tag.msel.active = false; pane.tag.nsel = 0; pane.tag.cur_pinned = true; const at = tagline.tagOffsetAt(p, pane, @intCast(@max(0, pointed.sel.r0)), @intCast(@max(0, pointed.sel.c0))) orelse modal.Cursor{ .row = 0, .col = 0 }; @@ -1144,7 +1143,6 @@ fn mirrorTtySelection(p: *Pardes, pane: *Pane) void { } pane.body.cur_col = @intCast(modal.graphemeStart(shown, @min(shown.len, byte -| endpoint.prompt_bytes))); pane.body.cur_pinned = true; - pane.body.msel.active = false; pane.body.vsel.active = false; pane.body.nsel = 0; pane.body.select = false; @@ -1308,7 +1306,6 @@ fn dragRelease(p: *Pardes, button: Mouse.Button) void { ); pane.body.cur_pinned = true; if (edit.clampFileCursor(&pane.body)) pane.ensureCursorVisible(); - pane.body.msel.active = false; pane.body.normal.clear(); pane.body.vsel.active = false; pane.body.nsel = 0; // a click says WHERE the one cursor is @@ -1353,7 +1350,6 @@ fn dragRelease(p: *Pardes, button: Mouse.Button) void { // must not stretch to it; borrowed selections retain // their original cursor and extent. pane.body.vsel.active = false; - pane.body.msel.active = false; pane.body.nsel = 0; pane.body.select = false; pane.body.cur_row = operand.row; @@ -1427,7 +1423,6 @@ fn chordCutPaste(p: *Pardes, cut: bool) void { t.cur_col = @intCast(to.col); t.cur_pinned = true; t.vsel = .{ .active = from.row != to.row or from.col != to.col, .row = @intCast(from.row), .col = @intCast(from.col), .explicit = false }; - t.msel.active = false; t.nsel = 0; } if (cut) { @@ -1479,7 +1474,6 @@ fn chordCutPaste(p: *Pardes, cut: bool) void { pane.body.cur_row = row1; pane.body.cur_col = col1; pane.body.cur_pinned = true; - pane.body.msel.active = false; pane.body.normal.clear(); if (!pane.isTerminal()) pane.body.mode = .normal; pane.body.vsel = .{ .active = row0 != row1 or col0 != col1, .row = row0, .col = col0, .explicit = false }; @@ -1522,7 +1516,6 @@ test "plain left click clears explicit modal selection" { pane.body.cur_row = 0; pane.body.cur_col = 5; pane.body.vsel = .{ .active = true, .row = 0, .col = 1, .explicit = true }; - pane.body.msel = .{ .active = true, .r0 = 0, .r1 = 0 }; var frame = std.heap.ArenaAllocator.init(gpa); defer frame.deinit(); @@ -1535,7 +1528,6 @@ test "plain left click clears explicit modal selection" { try std.testing.expectEqual(@as(i32, 3), pane.body.cur_col); try std.testing.expect(!pane.body.vsel.active); - try std.testing.expect(!pane.body.msel.active); try std.testing.expectEqual(.none, pane.sel[@backingInt(config.select_button)].state); } |
