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:
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).
It turns out that the underlying cause is a VIM bug in setline():
Since delimiteMate defaults to disabling CR expansion in comments, this bug is triggered.
Heyo! I see the bug is closed but wondering:
There is no workaround at the moment. Try the old thread, Bram or someone else might be inspired to look into it.