From: On Behalf Of ZyX
> Subject: Re: [BUG?] Modifications of visual selection are not remembered
> during mapping execution
>
> It is already normal vimscript: equivalent to
> vim -N -u NONE -S <(<<EOF
> call setline(".", range(1000))
> function! EV()
> echom 0
> normal! gv30j
> endfunction
> vnoremap e :call EV()<CR>
> call feedkeys("V4je")
> EOF)
This can be simplified to
vim -N -u NONE -S <(<<EOF
call setline(".", range(1000))
call feedkeys("V4j:normal gv30j\<CR>")
EOF)
and still exhibit the behaviour. (The echom 0's are missing of course.)
It doesn't look like a problem with mappings.
The following exhibits the same behaviour
vim -N -u NONE -S <(<<EOF
call setline(".", range(1000))
call feedkeys("V4j\<Esc>")
call feedkeys(":1,5:normal gv30j\<CR>")
EOF)
> > > You will see that while function EV was called 5 times (five
> > > zeroes in :messages), cursor is on the line containing number 33,
> > > while it is expected to be on line with number 5*30=150.
It looks like what you want is something like
vim -N -u NONE
:call setline(".", range(1000))
V30jgv30jgv30jgv30jgv30j
(sorry, couldn't figure out how to wedge a [count] in there) but that
only works because when gv is typed there is no previous visual
selection to swap with so it fails to do anything. Equivilantly
vim -N -u NONE
:call setline(".", range(1000))
V30j30j30j30j30j
Perhaps you wanted a [count] instead of a [range]?
...Stu
--
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