diff options
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 |
