Lech Lorens wrote:
> It is possible to scroll down (i.e. CTRL-Y in normal mode) an empty
> buffer if it is being compared with another buffer consisting of at
> least two lines. This means it is possible for the cursor to appear
> "outside of the file" - on nonexistent lines.
>
> To reproduce the problem edit any file and e.g.:
> :diffsplit /dev/null
> Then try to scroll /dev/null with CTRL-Y.
>
> This patch disallows such behaviour.
The scrolling is OK so long as the filler lines fit in the window.
This is useful to be able to see the added lines in the other window.
But currently it tries to add too many, the cursor is displayed outside
of the window if you scroll far enough.
Please check this patch:
*** ../vim-7.2.267/src/move.c 2009-05-15 21:31:11.000000000 +0200
--- src/move.c 2009-10-28 21:49:17.000000000 +0100
***************
*** 1257,1263 ****
while (line_count-- > 0)
{
#ifdef FEAT_DIFF
! if (curwin->w_topfill < diff_check(curwin, curwin->w_topline))
{
++curwin->w_topfill;
++done;
--- 1257,1264 ----
while (line_count-- > 0)
{
#ifdef FEAT_DIFF
! if (curwin->w_topfill < diff_check(curwin, curwin->w_topline)
! && curwin->w_topfill < curwin->w_height - 1)
{
++curwin->w_topfill;
++done;
--
Life is a gift, living is an art. (Bram Moolenaar)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---