aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 1f84db6b..cea5a24e 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -3499,7 +3499,11 @@ fn hover(cx: &mut Context) {
// comments
fn toggle_comments(cx: &mut Context) {
let (view, doc) = current!(cx.editor);
- let transaction = comment::toggle_line_comments(doc.text(), doc.selection(view.id));
+ let token = doc
+ .language_config()
+ .and_then(|lc| lc.comment_token.as_ref())
+ .map(|tc| tc.as_ref());
+ let transaction = comment::toggle_line_comments(doc.text(), doc.selection(view.id), token);
doc.apply(&transaction, view.id);
doc.append_changes_to_history(view.id);