aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorNathan Vegdahl2021-07-19 05:02:12 +0000
committerNathan Vegdahl2021-07-19 05:02:12 +0000
commite462f32723bb61899a390f438d7d856d87fb7614 (patch)
treee97a9afbf07e2735ba96d62dd5e8f71e1a241fe1 /helix-term/src/commands.rs
parent6c038bb0151c6aeb43fc94bd2dc3d516a71d346c (diff)
parent5292fe0f7df9f1a420744007aa9dd67e7a5a6610 (diff)
Merge branch 'master' into great_line_ending_and_cursor_range_cleanup
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);