On Wednesday, March 19, 2014 2:43:46 PM UTC-5, Christian Brabandt wrote:
> > The problem is, that executing "startinsert" while in replace mode
> 
> > doesn't seem to do anything. "startreplace" when in insert mode
> 
> > likewise has no effect, and the same for "startgreplace".
> 
> > 
> 
> > Using "stopinsert | startinsert" doesn't work either; the editor just
> 
> > seems to ignore the startinsert altogether if I do that, leaving it in
> 
> > normal mode always.
> 
> 
> 
> This seems to work here (7.4.155, terminal and gtk gvim).
> 
> 

What part works?

Here is a Vim I just tested in Windows 7 64-bit:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 24 2014 08:11:09)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-213
Compiled by [email protected]:http://SteveHallArchitecture.com
Huge version with GUI.  Features included (+) or not (-):

In this version, I source my original script (repeated at the end of this 
message), then create 4 total tabs. In the first tab, I leave Vim in insert 
mode. I go to the second tab, enter insert mode, then click on tab 3 to switch 
to it without leaving insert mode. On tab 3, I press R to enter replace mode. I 
click to enter tab 4 again without leaving the mode. On tab 4 I enter vreplace 
mode by pressing gR. If I then click on tab 1 Vim is in normal mode again 
(good). If I click on tab 2 Vim is in insert mode (good). If I click back on 
tab 1 then on tab 3 Vim is in replace mode (good). If I click back on tab 1 
then on tab 4 Vim is in vreplace mode (good). But now that I am on tab 4, if I 
click on tab 2 or tab 3 without clicking tab 1 first, Vim stays in vreplace 
mode. The same thing happens for the insert and replace mode tabs. Vim does not 
switch between the various insert modes, although switching between insert 
modes and normal mode works just fine.

Here is the script I sourced, again:

    augroup TAB_MODES 
      au! 
      autocmd TabLeave * let t:lastmode = mode(1) 
      autocmd TabEnter * if !exists('t:lastmode') | let t:lastmode = 'n' | 
endif 
      autocmd TabEnter * if t:lastmode ==# 'n'  | stopinsert    | endif 
      autocmd TabEnter * if t:lastmode ==# 'i'  | startinsert   | endif 
      autocmd TabEnter * if t:lastmode ==# 'R'  | startreplace  | endif 
      autocmd TabEnter * if t:lastmode ==# 'Rv' | startgreplace | endif 
    augroup END

-- 
-- 
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/d/optout.

Raspunde prin e-mail lui