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/Query.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/Query.zig')
| -rw-r--r-- | src/Query.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Query.zig b/src/Query.zig index 84725085..cb14df2b 100644 --- a/src/Query.zig +++ b/src/Query.zig @@ -1752,8 +1752,12 @@ fn displayPreview(p: *Pardes, qid: usize, path: []const u8, at: look.Spot) void else => {}, } if (selectPlace(p, pane, qp.serial, at)) return; - if (at.end_line == 0 or at.end_col <= at.col) - pane.body.msel = .{ .active = true, .r0 = @intCast(at.line - 1), .r1 = @intCast(at.line - 1) }; + if (at.end_line == 0 or at.end_col <= at.col) { + // the place's whole line, selected back from its end + pane.body.vsel = .{ .active = true, .row = @intCast(at.line - 1), .col = @intCast(File.textLine(&pane.body, f.content, at.line - 1).len), .explicit = true }; + pane.body.cur_row = @intCast(at.line - 1); + pane.body.cur_col = 0; + } } /// The +Preview becomes the file's pane where it stands: same slot, same |
