summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/lsp/Ask.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/lsp/Ask.zig b/core/lsp/Ask.zig
index b6d32558..bb1eccb6 100644
--- a/core/lsp/Ask.zig
+++ b/core/lsp/Ask.zig
@@ -38,6 +38,10 @@ wait: ?struct {
arg: Effect.Buf(128),
row: i32 = 0,
col: i32 = 0,
+ /// A hover asked from the keyboard where jumps walk (Pick.asked, when
+ /// asked: a 9P script's answer comes after its write): drawn as ghost
+ /// lines, no +Hover pane.
+ ghost: bool = false,
} = null,
/// A hover asked from the keyboard (where the walk is on), drawn as ghost
/// lines under the line it was asked at in its own body (pick-ui SPEC §3.5,
@@ -121,6 +125,7 @@ pub fn lspRequest(p: *Pardes, asked: usize, kind: lsp.Kind, arg_in: []const u8)
.arg = .from(arg),
.row = pane.body.cur_row,
.col = pane.body.cur_col,
+ .ghost = kind == .hover and pardes.Pick.asked(p),
};
p.emit(.{ .lsp = .{
.id = p.lsp_ask.seq,
@@ -386,7 +391,7 @@ pub fn lspResponse(p: *Pardes, id: u32, response: ?[]const u8) void {
// A hover asked from the keyboard: ghost lines in its own body, no
// +Hover pane (SPEC §3.5).
- if (w.kind == .hover and pardes.Pick.asked(p)) {
+ if (w.kind == .hover and w.ghost) {
var cut = @min(rows.len, hover_max);
while (cut < rows.len and cut > 0 and rows[cut] & 0xC0 == 0x80) cut -= 1;
p.lsp_ask.hover = .{ .serial = pane.serial, .row = w.row, .revision = w.revision, .text = .from(rows[0..cut]) };