72017Re: Breaking undo in Insert mode
- Jul 9, 2013On Tue, Jul 9, 2013 at 5:54 AM, Bram Moolenaar <Bram@...> wrote:
>I don't remember how setline() solves the problem, but just returning
> That can be done by returning cursor key sequences. No need for
> imap ( <C-R>=LeftParen()<CR>
> fun! LeftParen()
> return "()\<Left>"
> imap ) <C-R>=RightParen()<CR>
> fun! RightParen()
> return "\<Right>"
cursor sequences doesn't work, because it breaks undo/redo/repeat.
If I insert abc(123) with mappings like, then press '.' somewhere
else, I will only get the 123 inserted. Pressing 'u' after inserting
"abc(123) + 456" will only undo the " + 456".
The mappings that used to work to get around this are complicated;
hence the reason I'm using a plugin instead of simple mappings; but
previously somehow using setline() allowed all of undo, redo, and
repeat to work as if there were not any mappings. Now only repeat
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
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
For more options, visit https://groups.google.com/groups/opt_out.
- << Previous post in topic Next post in topic >>