summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 00:35:15 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:17:28 -0300
commitd5158f6a69ce5a1af6372c140b07379ee0ba2446 (patch)
treeec722719840f59263e4b7dbc740681594b526274 /src/look.zig
parent3b31e0484bd06658f10cd9165b76cb1ca3b198bd (diff)
downloadpardes-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/look.zig')
-rw-r--r--src/look.zig10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/look.zig b/src/look.zig
index f6095fb9..f47f0b15 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -567,7 +567,6 @@ fn lookFirstHit(p: *Pardes, id: usize) void {
const txt = edit.currentSelText(p, rp) orelse return;
// spent, exactly as the look chord spends it (handleKey)
rp.body.vsel.active = false;
- rp.body.msel.active = false;
rp.body.select = false;
exec.runBuiltin(p, config.look_cmd, rid, "", txt);
}
@@ -678,8 +677,8 @@ pub fn jumpResult(p: *Pardes, id: usize, row: usize) bool {
if (ln.len == 0) return false;
const r: i32 = @intCast(row);
pane.search_row = row;
- rp.body.msel = .{ .active = true, .r0 = r, .r1 = r };
- rp.body.vsel.active = false;
+ // the visited result, selected back from its line's end
+ rp.body.vsel = .{ .active = true, .row = r, .col = @intCast(ln.len), .explicit = true };
rp.body.nsel = 0;
rp.body.cur_row = r;
rp.body.cur_pinned = true;
@@ -714,7 +713,7 @@ pub fn jumpResult(p: *Pardes, id: usize, row: usize) bool {
lookAt(p, rid, ln[selected.start..selected.end]);
// This is the newly visited result, not a selection carried into
// the destination. Look cleared the previous source selection.
- rp.body.msel = .{ .active = true, .r0 = r, .r1 = r };
+ rp.body.vsel = .{ .active = true, .row = r, .col = @intCast(ln.len), .explicit = true };
}
armLookWalk(p, rid);
return true;
@@ -884,7 +883,6 @@ pub fn lookWalk(p: *Pardes, delta: i32) void {
fn landLookSpot(p: *Pardes, id: usize, pane: *Pane, spot: Pane.LookSpot) void {
edit.pinPaneCursor(p, &pane.body); // fresh out of tty mode the cursor still tracks the shell
pane.body.vsel = .{ .active = true, .row = spot.row, .col = spot.col1, .explicit = true };
- pane.body.msel.active = false;
pane.body.nsel = 0;
pane.body.cur_row = spot.row;
pane.body.cur_col = spot.col0;
@@ -1065,7 +1063,6 @@ fn focusPaneByPath(p: *Pardes, path: []const u8, at: Spot) bool {
/// Navigation starts a new selection at the destination.
pub fn clearNavigationSelection(p: *Pardes, pane: *Pane) void {
pane.body.vsel = .{};
- pane.body.msel = .{};
pane.body.nsel = 0;
pane.body.select = false;
pane.body.normal.clear();
@@ -2491,7 +2488,6 @@ test "every entry point to Look takes one expansion: a diff line and a file:12:5
p.active = 0;
pane.body.mode = .normal;
pane.body.vsel.active = false;
- pane.body.msel.active = false;
pane.body.cur_row = case.row;
pane.body.cur_col = case.col;
pane.body.cur_pinned = true;