Problem: With 'smartindent' inserting '}' after completion goes wrong.
Solution: Check the cursor is in indent. (closes #10420)
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)
call setline(1, 'foo foot')
call feedkeys("o f\<C-X>\<C-N>#", 'tx')
call assert_equal(' foo#', getline(2))
+
+ call setline(2, '')
+ call feedkeys("1Go f\<C-X>\<C-N>}", 'tx')
+ call assert_equal(' foo}', getline(2))
+
bwipe!
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4953,
/**/
4952,
/**/