From 7d41550a23fc3506a37016d5bc362144fb00c080 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 8 Jan 2021 16:15:12 +0900 Subject: indent: refactor logic to be more correct. Thanks to atom-sane-indentation, nvim-treesitter and tree-sitter-indent.el for inspiration. --- helix-term/src/commands.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'helix-term/src/commands.rs') diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 8216437d..a11c3145 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -535,6 +535,7 @@ pub fn open_below(cx: &mut Context) { cx.view.doc.syntax.as_ref(), &cx.view.doc.state, index, + true, ); let indent = " ".repeat(TAB_WIDTH).repeat(indent_level); let mut text = String::with_capacity(1 + indent.len()); @@ -654,6 +655,7 @@ pub mod insert { cx.view.doc.syntax.as_ref(), &cx.view.doc.state, range.head, + true, ); let indent = " ".repeat(TAB_WIDTH).repeat(indent_level); let mut text = String::with_capacity(1 + indent.len()); -- cgit v1.2.3-70-g09d2