Sunday, April 29, 2012

RE: Cursor anomoly: apparent and actual positions differ

I confirm there is a bug (Vim 7.3.509 on Windows).

I slightly simplified the example to show the minimum that
demonstrates the problem, as below:

" ----------- start bug.txt ------------------
" To show anomaly, launch Vim as:
" vim -N -u NONE bug.txt
" and enter:
" :so %
" :13
"
if v:version >= 700
au BufLeave * let b:winview = winsaveview()
au BufEnter * if exists('b:winview') | call winrestview(b:winview) | endif
endif
"
" Now enter:
" :copen
" CTRL-W CTRL-W
" Stop and see where cursor is, then press j
" which shows that cursor was NOT where it appeared to be.
" First pressing Ctrl-L or entering :redraw do not help.
" ----------- end bug.txt --------------------

There is no problem if use ':new' or ':rightbelow new' instead
of ':copen'. Seems the quickfix window is part of problem.

I can also see the problem if start Vim normally, then just yank
the two au commands and use :@" to source them, then enter
:copen Ctrl-W w. I have seen the cursor end up in the tildes
after end-of-file.

Using ':echo b:winview' shows:
{'lnum': 13, 'leftcol': 0, 'col': 0, 'topfill': 0,
'topline': 11, 'coladd': 0, 'skipcol': 0, 'curswant': 0}

It looks like topline is wrong.

John

--
You received this message from the "vim_use" 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

No comments: