fix: use byte postion instead of column offset in highlight references requests

closes #451
This commit is contained in:
CJ van den Berg 2026-01-12 16:35:31 +01:00
parent e61d0f42b8
commit bfd98c3b90
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -6180,7 +6180,9 @@ pub const Editor = struct {
pub fn highlight_references(self: *Self, _: Context) Result { pub fn highlight_references(self: *Self, _: Context) Result {
const file_path = self.file_path orelse return; const file_path = self.file_path orelse return;
const primary = self.get_primary(); const primary = self.get_primary();
return project_manager.highlight_references(file_path, primary.cursor.row, primary.cursor.col); const root = self.buf_root() catch return;
const pos = root.get_line_width_to_pos(primary.cursor.row, primary.cursor.col, self.metrics) catch return;
return project_manager.highlight_references(file_path, primary.cursor.row, pos);
} }
pub const highlight_references_meta: Meta = .{ .description = "Language: Highlight references" }; pub const highlight_references_meta: Meta = .{ .description = "Language: Highlight references" };