Responding mainly to set a topic. Sorry about that. Normally gmail warns me 
about not having a subject. Not today apparently.

I have seen this hack in other plugins as well, mostly related to automatically 
adding text or moving the cursor in insert mode.

On Wednesday, July 3, 2013 3:45:32 PM UTC-5, Ben Fritz wrote:
> I use the delimitMate plugin by Israel Chauca Fuentes:
> 
> 
> 
>   http://www.vim.org/scripts/script.php?script_id=2754
> 
>   https://github.com/Raimondi/delimitMate
> 
> 
> 
> I found this plugin to be "the best" at automatically inserting the
> 
> closing character for "paired" characters like (..), [..], etc. It is
> 
> customizeable, and until recently, did not affect undo/redo/repeat.
> 
> 
> 
> But, this plugin uses setline() internally, taking advantage of the
> 
> "bug" fixed recently, that calling setline() in insert mode does not
> 
> break the undo sequence. So, in Vim 7.3.1169, I can type the following:
> 
> 
> 
>   aone two three<Esc>
> 
> 
> 
> Pressing 'u' would undo the entire insertion. With 7.3.1298, pressing
> 
> 'u' removes each word individually, because <Space> triggers some logic
> 
> in delimitMate.
> 
> 
> 
> It is even more annoying when delimitMate actually inserts anything.
> 
> Typing the following with delimitMate installed:
> 
> 
> 
>   aone two(three<Esc>
> 
> 
> 
> Will actually insert the text:
> 
> 
> 
>   one two(three)
> 
> 
> 
> So far, so good. Pressing '.' to repeat likewise still works. But when
> 
> pressing 'u', in 1169 the entire insert is undone. In 1298, the first
> 
> press gets rid of three) and the second press gets rid of the rest.
> 
> 
> 
> Similar problems also occur when using the mapping to skip past an
> 
> existing ) instead of inserting a new one when pressing ) in insert
> 
> mode.
> 
> 
> 
> I think, what is needed, is a method in insert mode, to insert text
> 
> after the cursor and/or move the cursor, without breaking the undo
> 
> sequence. The setline() thing was always a hack, I admit.
> 
> 
> 
> Oddly it looks like Israel's name is on the 7.3.1200 issue description,
> 
> so presumably he's aware of this. But the latest version of his plugin
> 
> from GitHub breaks as described. And honestly I think it somewhat
> 
> strange that I need a complicated plugin using setline(), etc. to avoid
> 
> breaking undo/redo for something as simple as inserting an extra ) while
> 
> typing in insert mode, or moving the cursor beyond the ) when typing a
> 
> new one.

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui