Skip to content

Commit

Permalink
fix: hover should convert column to byte position in LSP request
Browse files Browse the repository at this point in the history
closes: #85
  • Loading branch information
neurocyte committed Dec 20, 2024
1 parent 030b3cb commit 1aa64b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tui/editor.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3975,7 +3975,9 @@ pub const Editor = struct {

pub fn hover_at(self: *Self, row: usize, col: usize) Result {
const file_path = self.file_path orelse return;
return project_manager.hover(file_path, row, col);
const root = self.buf_root() catch return;
const pos = root.get_line_width_to_pos(row, col, self.metrics) catch return;
return project_manager.hover(file_path, row, pos);
}

pub fn add_diagnostic(
Expand Down

0 comments on commit 1aa64b8

Please sign in to comment.