Undo broken by autoclose plugin
set autoindent
set smartindent
set cindent " Bad for js, unless you set the following cino!
" Pretty decent js indentation without a plugin - wow!
set cino=-jJ1j1
" If really large declarative ui blocks - you might need to search far (50 lines)
set cino+=(50
With these settings, open up a file new.js (javascript)
type out the following code:
var x = {
asdf: 'hi'
};
without leaving insert mode. Then exit insert mode and type "u" for undo. It does not undo everything, and leaves the trailing "}". What's really bad, is that when you Redo, it doesn't even redo correctly so your text is messed up forever.
I can't reproduce broken redo (confirm broken undo though)
thre are two ways I can enter the above fragment, depending on when I enter the semicolon, either:
... {,},;,LEFT,LEFT,ENTER ...
or:
{,ENTER, .... , DOWN, ;
In the first case there are two undo points to make the whole fragment go away and redo restores it.
In the second case there are two undo points (first undo ;, then undo the rest) but the second one is broken (leaves the closing brace). But redoing isn't broken for me, the text gets restored correctly.
This has something to do with enter expansion, I'll look into it.
I can confirm that undo is broken, but I can't reproduce theredo bug, too.