Raimondi / delimitMate

Vim plugin, provides insert mode auto-completion for quotes, parens, brackets, etc.
http://www.vim.org/scripts/script.php?script_id=2754
1.98k stars 117 forks source link

Broken history with delimitMate #114

Closed dmayle closed 11 years ago

dmayle commented 11 years ago

For a while now, I've run into the occasional issue where I seem to be able to paste through vim history, so that undo doesn't work for certain changes.

It's taken me six months to figure out what was causing it, and come up with a working test case. As it turns out, a fresh install with just delimitMate triggers the behavior:

Either from a new instance or a fresh buffer (:enew), I hit 'a' and type the following: foo>baru

That is, I type 'foo' followed by a closing bracket, then carriage return, type 'bar', escape and undo. The undo removes the line with 'foo>' on it, and leaves 'bar' indelibly stuck in history.

It has to be done with 'i' or 'a' (insert or append), not 'o' (append blank line and start insert mode there).

dmayle commented 11 years ago

It turns out that the underlying cause is a VIM bug in setline(): https://groups.google.com/forum/?fromgroups=#!topic/vim_use/yRcEE2eO8TQ

Since delimiteMate defaults to disabling CR expansion in comments, this bug is triggered.

mimecuvalo commented 11 years ago

Heyo! I see the bug is closed but wondering:

Raimondi commented 11 years ago

There is no workaround at the moment. Try the old thread, Bram or someone else might be inspired to look into it.