fix: use byte postion instead of column offset in highlight references requests
closes #451
This commit is contained in:
parent
e61d0f42b8
commit
bfd98c3b90
1 changed files with 3 additions and 1 deletions
|
|
@ -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" };
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue