summaryrefslogtreecommitdiff
path: root/src/exec.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/exec.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/exec.zig')
-rw-r--r--src/exec.zig13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/exec.zig b/src/exec.zig
index 4706d11a..b1ee55d4 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -67,7 +67,6 @@ pub fn chordEachSel(p: *Pardes, pane: *Pane, cmd: Builtin) bool {
const id = p.active;
const serial = pane.serial;
pane.body.vsel.active = false;
- pane.body.msel.active = false;
pane.body.select = false;
pane.body.nsel = 0; // the chord consumed them, exactly as it consumes one
@@ -104,7 +103,7 @@ pub const PointerOperand = struct {
/// The body's explicit selection, else what a look at its cursor takes.
pub fn currentOperand(p: *Pardes, pane: *Pane) ?[]const u8 {
if (pane.file == null and !pane.isTerminal()) return null;
- if ((pane.body.vsel.active and pane.body.vsel.explicit) or pane.body.msel.active) return edit.currentSelText(p, pane);
+ if (pane.body.vsel.active and pane.body.vsel.explicit) return edit.currentSelText(p, pane);
return operandAt(p, pane, look.cursorWordSel(p, pane), false, true).text;
}
@@ -172,12 +171,6 @@ pub fn operandAt(p: *Pardes, pane: *Pane, clicked: Pane.Sel, borrow: bool, for_l
result.text = edit.currentSelText(p, pane);
return result;
}
- if (pane.body.msel.active and row >= @min(pane.body.msel.r0, pane.body.msel.r1) and
- row <= @max(pane.body.msel.r0, pane.body.msel.r1))
- {
- result.text = edit.currentSelText(p, pane);
- return result;
- }
}
// In a diff, a file or hunk header, and a hunk line pointed at on its
// `+`/`-`/` ` prefix, expand to the whole line (the hover shows it) and
@@ -283,7 +276,7 @@ pub fn heldSelection(p: *Pardes, first: usize) ?[]const u8 {
};
if (t.sel[sel_slot].state == .done) {
if (edit.selectionText(p, t, t.sel[sel_slot]) catch null) |tx| return tx;
- } else if ((t.body.vsel.active and t.body.vsel.explicit) or t.body.msel.active) {
+ } else if (t.body.vsel.active and t.body.vsel.explicit) {
if (edit.currentSelText(p, t)) |tx| return tx;
}
}
@@ -296,7 +289,7 @@ pub fn heldSelectionPlace(p: *Pardes, first: usize, buf: []u8) ?[]const u8 {
for (0..p.panes.len + 2) |k| {
const t = heldPane(p, first, k) orelse continue;
if (t.sel[sel_slot].state == .done) return null; // a pointer selection: no byte range kept
- if ((t.body.vsel.active and t.body.vsel.explicit) or t.body.msel.active) {
+ if (t.body.vsel.active and t.body.vsel.explicit) {
const f = t.file orelse return null;
const d = @import("ninep/pane.zig").dotOf(t);
return std.fmt.bufPrint(buf, "{s}:#{d},#{d}", .{ f.path, d.q0, d.q1 }) catch null;