On 28-10-2009 Bram Moolenaar <[email protected]> wrote: > > 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:
Your patch does not seem to address the problem I've been trying to describe. I am not sure whether I have managed to explain the problem I am observing well enough. I will draw what I am observing: ~ - are the nonexistent line, i.e. after the end of the file, _ - is the cursor I have 2 windows in diff mode, the cursor is on the only displayed line in window 1. window 1 window 2 /dev/null file.txt +------------+------------+ |_ |last line | |~ |~ | |~ |~ | |~ |~ | |~ |~ | |~ |~ | +------------+------------+ If I press CTRL-Y twice, the situation is as follows: +------------+------------+ | |last line | |~ |~ | |_ |~ | |~ |~ | |~ |~ | |~ |~ | +------------+------------+ which means the cursor is displayed out of bounds - on the second nonexistent line. Also, from your reply I infer that my patch breaks some functionality. I haven't observed any such side effects. Could you elaborate on it a little bit? Thanks in advance. -- Cheers, Lech --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
