Yakov Lerner wrote:
On 11/1/06, Ryan Phillips <[EMAIL PROTECTED]> wrote:
Hi all.

I have just noticed a problem with bufnext and bufprev with two
(plus+) different files open within (g)vim.

Attached my vim --version for review.

OS: Linux, Ubuntu Edgy

Steps to reproduce:
    * Create a file ~140 lines long with A'S, TEST_A
    * cp TEST_A TEST_A_2
    * vim TEST_A TEST_A_2 --noplugins
    * In buf #1 scroll to a line number > 30.  I selected 38 to be at
      the top of my terminal. (I have line numbers turned on)
    * :bn   # to go to TEST_A_2
    * :bp   # to return to Buf #1

The first buffer has jumped N lines forward within the file.  N
appears to be a constant 22 for me.  Can anyone else reproduce this?

You can try the following commands in your vimrc, which
remove the screen repositioning:

 " when switching buffers, preserve window view
 if v:version >= 700
 au BufLeave * let b:winview = winsaveview()
au BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | endif
 endif

I posted this as tip (http://vim.sourceforge.net/tips/tip.php?tip_id=1375)

Yakov

Yakov:

Thank you for the clarification.  That works for me.

-Ryan

Reply via email to