fix: hover should convert column to byte position in LSP request

closes: #85
This commit is contained in:
CJ van den Berg 2024-12-20 17:56:04 +01:00
parent 030b3cb139
commit 1aa64b8ea4
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -3975,7 +3975,9 @@ pub const Editor = struct {
pub fn hover_at(self: *Self, row: usize, col: usize) Result { pub fn hover_at(self: *Self, row: usize, col: usize) Result {
const file_path = self.file_path orelse return; 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( pub fn add_diagnostic(