Skip to content

Commit 8b6565c

Browse files
the-mikedavisarchseer
authored andcommitted
Respect injections in :tree-sitter-highlight-name
1 parent 5e0b3cc commit 8b6565c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

helix-term/src/commands/typed.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,10 +1546,7 @@ fn tree_sitter_highlight_name(
15461546
let text = doc.text().slice(..);
15471547
let cursor = doc.selection(view.id).primary().cursor(text);
15481548
let byte = text.char_to_byte(cursor);
1549-
let node = syntax
1550-
.tree()
1551-
.root_node()
1552-
.descendant_for_byte_range(byte, byte)?;
1549+
let node = syntax.descendant_for_byte_range(byte, byte)?;
15531550
// Query the same range as the one used in syntax highlighting.
15541551
let range = {
15551552
// Calculate viewport byte ranges:

0 commit comments

Comments
 (0)