Skip to content

Commit

Permalink
Respect injections in :tree-sitter-highlight-name
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis authored and archseer committed Jan 28, 2024
1 parent 5e0b3cc commit 8b6565c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1546,10 +1546,7 @@ fn tree_sitter_highlight_name(
let text = doc.text().slice(..);
let cursor = doc.selection(view.id).primary().cursor(text);
let byte = text.char_to_byte(cursor);
let node = syntax
.tree()
.root_node()
.descendant_for_byte_range(byte, byte)?;
let node = syntax.descendant_for_byte_range(byte, byte)?;
// Query the same range as the one used in syntax highlighting.
let range = {
// Calculate viewport byte ranges:
Expand Down

0 comments on commit 8b6565c

Please sign in to comment.