On Vim 7.4 this problem is documented on :help todo
":pedit %" with a BufReadPre autocommand causes the cursor to move to the
first line. (Ingo Karkat, 2008 Jul 1) Ian Kelling is working on this.
But the bug has somehow propagated to :edit command:
gvim -N -u NONE
" Just open a file with a couple of lines and go to the end.
:e + $VIMRUNTIME/vimrc_example.vim
:echo line('.')
:split
:windo echo line('.')
96
96
" Okay, both windows still at the end.
:au BufReadPre * let g:isExecuted = 1
:edit
" By now, the cursor has jumped to the first line in the original window
:windo echo line('.')
1
96
regards
--
View this message in context:
http://vim.1045645.n5.nabble.com/BUG-BufReadPre-autocmd-changes-cursor-position-on-pedit-tp1206965p5721472.html
Sent from the Vim - Dev mailing list archive at Nabble.com.
--
--
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.