66603Re: [patch] implement undo in :s_flags
- Oct 1, 2012On Sun, September 30, 2012 15:41, Andy Wokula wrote:
> Am 30.09.2012 14:42, schrieb Bram Moolenaar:This works, although I would personally don't think this is very
>> Christian Brabandt wrote:
>>> attached patch implements undo when doing :s/.../.../gc
>>> This has been requested recently in
>>> And I think, I saw a request like this on the sf.net bug tracker, but I
>>> can't find it right now. Additionally, I also added using Ctrl-L for
>>> redrawing the screen as I found this useful.
>> 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.
> What about a replacement function that edits text?
> com! InsaneSubst :%s/\w\+/\=InsaneEdit(submatch(0))/
> func! InsaneEdit(str)
> $put = a:str
> return '('. a:str. ')'
reasonable. :%s will not consider the newly added lines (it determines
the range before starting the command) and I have seen strange effects
when doing a replacement and the function changes the text directly
(e.g. E315 ml_get: invalid lnum...)
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
- << Previous post in topic Next post in topic >>