From 7a1ff5e45f829df17dfdcbd4923ae9e83fc2bf3f Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 19 Feb 2021 13:59:24 +0900 Subject: commands: Wire up toggle comments as ctrl-c --- helix-term/src/commands.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'helix-term/src/commands.rs') diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 621e1223..4fe80971 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1,5 +1,5 @@ use helix_core::{ - graphemes, + comment, graphemes, indent::TAB_WIDTH, regex::Regex, register, selection, @@ -1077,3 +1077,11 @@ pub fn completion(cx: &mut Context) { pub fn next_view(cx: &mut Context) { cx.editor.tree.focus_next() } + +// comments +pub fn toggle_comments(cx: &mut Context) { + let doc = cx.doc(); + let transaction = comment::toggle_line_comments(&doc.state); + + doc.apply(&transaction); +} -- cgit v1.2.3-70-g09d2