aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index f2982aa187..215024f63a 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -9344,10 +9344,8 @@ static void ins_try_si(int c)
/*
* do some very smart indenting when entering '{' or '}'
*/
- if (((did_si || can_si_back) && c == '{') || (can_si && c == '}')) {
- /*
- * for '}' set indent equal to indent of line containing matching '{'
- */
+ if (((did_si || can_si_back) && c == '{') || (can_si && c == '}' && inindent(0))) {
+ // for '}' set indent equal to indent of line containing matching '{'
if (c == '}' && (pos = findmatch(NULL, '{')) != NULL) {
old_pos = curwin->w_cursor;
/*