vim-autoclose icon indicating copy to clipboard operation
vim-autoclose copied to clipboard

Undo broken by autoclose plugin

Open jordwalke opened this issue 13 years ago • 2 comments

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.

jordwalke avatar Feb 26 '12 05:02 jordwalke

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.

artm avatar Feb 26 '12 07:02 artm

I can confirm that undo is broken, but I can't reproduce theredo bug, too.

kyrylo avatar Oct 05 '12 23:10 kyrylo