int in_indent;
int oldState;
int cpc[MAX_MCO]; // composing characters
+#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
+ int call_fix_indent = FALSE;
+#endif
/*
* can't delete anything in an empty file
save_col = curwin->w_cursor.col;
beginline(BL_WHITE);
if (curwin->w_cursor.col < save_col)
+ {
mincol = curwin->w_cursor.col;
+#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
+ // should now fix the indent to match with the previous line
+ call_fix_indent = TRUE;
+#endif
+ }
curwin->w_cursor.col = save_col;
}
#endif
if (curwin->w_cursor.col <= 1)
did_ai = FALSE;
+
+#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
+ if (call_fix_indent)
+ fix_indent();
+#endif
+
/*
* It's a little strange to put backspaces into the redo
* buffer, but it makes auto-indent a lot easier to deal
END
call assert_equal(expected, getline(1, '$'))
- " Using "o" repeates the line comment, "O" does not.
+ " Using "o" repeats the line comment, "O" does not.
%del
let text =<< trim END
nop;
END
call assert_equal(expected, getline(1, '$'))
+ " Using CTRL-U after "o" fixes the indent
+ %del
+ let text =<< trim END
+ {
+ val = val; // This is a comment
+ END
+ call setline(1, text)
+ exe "normal! 2Go\<C-U>x\<Esc>"
+ let expected =<< trim END
+ {
+ val = val; // This is a comment
+ x
+ END
+ call assert_equal(expected, getline(1, '$'))
+
bwipe!
endfunc