aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorFisher Darling2022-10-19 22:17:50 +0000
committerGitHub2022-10-19 22:17:50 +0000
commit4174b25b3d0d39c09a6d4bcd7fa22ee98be52ed1 (patch)
treeb0ac2509390a19e36e606ad4f3fb959e5542754c /helix-term
parenta7e7c2cc05d0998d8e45664cd3cb8b3ac46cca0e (diff)
Pretty print `tree-sitter-subtree` expression (#4295)
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands/typed.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index 1bfc8153..13a0adcf 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -1487,7 +1487,9 @@ fn tree_sitter_subtree(
.root_node()
.descendant_for_byte_range(from, to)
{
- let contents = format!("```tsq\n{}\n```", selected_node.to_sexp());
+ let mut contents = String::from("```tsq\n");
+ helix_core::syntax::pretty_print_tree(&mut contents, selected_node)?;
+ contents.push_str("\n```");
let callback = async move {
let call: job::Callback =