On Sun, September 30, 2012 14:42, Bram Moolenaar wrote:
>> attached patch implements undo when doing :s/.../.../gc
>
> Yeah, this is useful.  But also tricky, if the undo is done wrong then
> the text may get messed up.  Can you think of situations where something
> could go wrong?  And it would be nice to have tests for that.
>

Updated patch also works for undo in vi-compatible way and includes a
test. The testing part was harder than expected, because vim doesn't
sync undo, when reading from a script, so I explicitly sync undo
when using :s/.../.../c and reading from a script.

There is one limitation so: Vim only stores up to 256 places for where
to start searching after an undo. If you have replaced more, Vim won't
start at the correct column afterwards. I thought about using a garray_T
for storing the column, but wasn't successful.

regards,
Christian.

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Attachment: s_undo.diff
Description: Binary data

Raspunde prin e-mail lui