0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.4953: with 'si' inserting '}' after completion goes wrong

Problem:    With 'smartindent' inserting '}' after completion goes wrong.
Solution:   Check the cursor is in indent.  (closes #10420)
This commit is contained in:
Bram Moolenaar
2022-05-14 12:54:23 +01:00
parent 98feacedf9
commit 2e444bbef0
3 changed files with 9 additions and 1 deletions

View File

@@ -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)