diff options
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands/typed.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index f1c3cb71..b13af03a 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -2117,11 +2117,7 @@ fn tree_sitter_subtree( let text = doc.text(); let from = text.char_to_byte(primary_selection.from()); let to = text.char_to_byte(primary_selection.to()); - if let Some(selected_node) = syntax - .tree() - .root_node() - .descendant_for_byte_range(from, to) - { + if let Some(selected_node) = syntax.descendant_for_byte_range(from, to) { let mut contents = String::from("```tsq\n"); helix_core::syntax::pretty_print_tree(&mut contents, selected_node)?; contents.push_str("\n```"); |