Skip to content

Commit

Permalink
refactor: use doc! macro
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaRevenco committed Dec 7, 2024
1 parent 167fa52 commit 5d62554
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,7 @@ fn tree_sitter_tree(
return Ok(());
}

let (_view, doc) = current_ref!(cx.editor);
let doc = doc!(cx.editor);

if let Some(syntax) = doc.syntax() {
let text = doc.text();
Expand All @@ -2180,9 +2180,10 @@ fn tree_sitter_tree(
Document::from(Rope::from(contents), None, cx.editor.config.clone()),
));

let (_view, doc) = current!(cx.editor);
let tree_sitter_tree_document = doc_mut!(cx.editor);

doc.set_language_by_language_id("tsq", cx.editor.syn_loader.clone())?
tree_sitter_tree_document
.set_language_by_language_id("tsq", cx.editor.syn_loader.clone())?
}
}

Expand Down

0 comments on commit 5d62554

Please sign in to comment.