diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-05-14 12:54:23 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-14 12:54:23 +0100 |
commit | 2e444bbef0f36535bf941f007f2961f3f66bbe87 (patch) | |
tree | 339b31cf21dc01e77bf19400c52ba88ac10c4374 /src/indent.c | |
parent | 98feacedf9c03b8db79da03508a2c3c25dac3e53 (diff) | |
download | vim-git-2e444bbef0f36535bf941f007f2961f3f66bbe87.tar.gz |
patch 8.2.4953: with 'si' inserting '}' after completion goes wrongv8.2.4953
Problem: With 'smartindent' inserting '}' after completion goes wrong.
Solution: Check the cursor is in indent. (closes #10420)
Diffstat (limited to 'src/indent.c')
-rw-r--r-- | src/indent.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/indent.c b/src/indent.c index dfc481a78..486259ef2 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1197,7 +1197,8 @@ ins_try_si(int c) int temp; // do some very smart indenting when entering '{' or '}' - if (((did_si || can_si_back) && c == '{') || (can_si && c == '}')) + 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) |