diff options
author | Michael Davis | 2024-01-25 19:29:49 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2024-01-28 09:13:33 +0000 |
commit | 8b6565c83924e7ef9176ae4611ec368fbf75ab8a (patch) | |
tree | a92b6244186be67f4e63357ae8314681fb964295 /helix-term/src | |
parent | 5e0b3cc28b8ae6da1f41b47080a695c99bbc844a (diff) |
Respect injections in :tree-sitter-highlight-name
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands/typed.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index ee02a7d2..81ffdf87 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -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: |