Le mardi 2 décembre 2014 10:44:13 UTC+1, jott...@googlemail.com a écrit :
> Hi,
> 
> Enno schrieb am 02.12.2014 um 10:06:
> > Le lundi 1 décembre 2014 20:42:50 UTC+1, v...@googlecode.com a écrit :
> >> Comment #3 on issue 290 by chrisbr...@googlemail.com: gVim does not jump 
> >> to  
> >> given linennumber if already at end of file
> >> https://code.google.com/p/vim/issues/detail?id=290
> >>
> >> Vim 7.4 works correctly with +[<number>] here (if no number is given, Vim  
> >> jumps to the last line number). I cannot reproduce the problem. Does it  
> >> happen if you start vim -u NONE -N +2
> >> ?
> > 
> > Let me provide exact instructions. Create an empty file ~/.gvimrc.light . 
> > and a file ~/.vimrc.light that reads
> > 
> > set nocompatible
> > filetype plugin indent on
> > syntax enable
> > 
> > Then create a file ~/file.txt that reads
> > 
> > a
> > b
> > c
> > d
> > e
> > 
> > Then 
> > 
> > gvim --servername GVIM2 +5 file.txt
> > gvim --servername GVIM2 --remote-send +1 file.txt
> > 
> > Expected: Cursor is in line 1. Reality: Cursor is in line 5.
> 
> independent of the corrections you sent later this will not work. When
> you take a look at
> 
>   :help --remote-send
> 
> you will see that --remote-send is used to send keystrokes to a running
> instance of Vim. The following parameter is interpreted as if you typed
> the respective keys in Vim by yourself.
> 
> In your example one correct command line would be
> 
>   gvim --servername GVIM2 --remote-send ":1<cr> file.txt
> 
> if you want to use an ex-command.
> 
> A different way would be
> 
>   gvim --servername GVIM2 --remote-send 1gg file.txt
> 
> which uses a normal mode command.
> 
> Regards,
> Jürgen
> 
> 
> -- 
> Sometimes I think the surest sign that intelligent life exists elsewhere
> in the universe is that none of it has tried to contact us.     (Calvin)

Ok. Thank you for the clarification. It turns out that the harmless looking map

cnoremap <expr> / getcmdtype() == '/' ? '\/' : '/' 

to escape / in command line searches was the culprit and turned exe into normal 
commands. That is:

Create an empty file ~/.gvimrc.light . and a file ~/.vimrc.light that reads 

--
set nocompatible 
filetype plugin indent on 
syntax enable 

cnoremap <expr> / getcmdtype() == '/' ? '\/' : '/' 
--

Then create a file ~/file.txt that reads 

--
a 
b 
c 
d 
e 
--

Then 

gvim --servername GVIM2 +5 file.txt 
gvim --servername GVIM2 +1 file.txt 

Expected: Cursor is in line 1. Reality: Cursor is in line 5.

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui