feat: display info box for hover content in hover_info_mode box mode
This commit is contained in:
parent
4a1b206d2b
commit
35563822ba
1 changed files with 8 additions and 6 deletions
|
|
@ -175,12 +175,14 @@ pub fn receive(self: *Self, from_: tp.pid_ref, m: tp.message) error{Exit}!bool {
|
||||||
if (self.get_editor_for_file(path)) |editor| editor.done_highlight_reference();
|
if (self.get_editor_for_file(path)) |editor| editor.done_highlight_reference();
|
||||||
return true;
|
return true;
|
||||||
} else if (try m.match(.{ "hover", tp.extract(&path), tp.string, tp.extract(&lines), tp.extract(&begin_line), tp.extract(&begin_pos), tp.extract(&end_line), tp.extract(&end_pos) })) {
|
} else if (try m.match(.{ "hover", tp.extract(&path), tp.string, tp.extract(&lines), tp.extract(&begin_line), tp.extract(&begin_pos), tp.extract(&end_line), tp.extract(&end_pos) })) {
|
||||||
try self.set_info_content(lines, .replace);
|
switch (tui.config().hover_info_mode) {
|
||||||
if (self.get_editor_for_file(path)) |editor|
|
.panel => self.set_info_content(lines, .replace) catch {},
|
||||||
editor.add_hover_highlight(.{
|
.box => if (self.get_editor_for_file(path)) |editor|
|
||||||
.begin = .{ .row = begin_line, .col = begin_pos },
|
editor.set_hover_content(.{
|
||||||
.end = .{ .row = end_line, .col = end_pos },
|
.begin = .{ .row = begin_line, .col = begin_pos },
|
||||||
});
|
.end = .{ .row = end_line, .col = end_pos },
|
||||||
|
}, lines) catch |e| return tp.exit_error(e, @errorReturnTrace()),
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (try m.match(.{ "navigate_complete", tp.extract(&path), tp.extract(&goto_args), tp.extract(&line), tp.extract(&column) })) {
|
} else if (try m.match(.{ "navigate_complete", tp.extract(&path), tp.extract(&goto_args), tp.extract(&line), tp.extract(&column) })) {
|
||||||
cmds.navigate_complete(self, null, path, goto_args, line, column, null) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
cmds.navigate_complete(self, null, path, goto_args, line, column, null) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue