Sunday, March 28, 2010

Re: Going back to normal mode from visual mode in a function

Am 28.03.2010 07:30, schrieb James Cole:
> Hi,
>
> At one point in a vim script function I'm writing, the system will be
> in visual mode and I want it to go back out of visual mode to normal
> mode.
>
> I know it doesn't really work to use something like 'normal! v'
> because if the visual mode it stared in was 'V' then that command will
> just change it to a character-based selection rather than going back
> to normal mode.
>
> If I use
>
> normal!<ESC>
>
> that's treated as just typing '<' 'E' 'S' 'C''>'
> [...]

When a function is entered from the command line, Visual mode will never
be active.

I'd change the logic to not enter Visual mode when it's going to be
cancelled later.

--
Andy

--
You received this message from the "vim_use" 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

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

No comments: