John Beckett wrote:

> On Sunday, August 28, 2016 at 8:05:29 PM UTC+10, toothpik wrote:
> >> :tabe expected.txt
> >> :vert diffs output.txt
> >
> >> When I last viewed those files, I may have exited with the cursor
> >> on the last line. I use the code from ":help restore-cursor" to
> >> restore the cursor position, so the diff shows the cursor at the
> >> bottom.
> >
> > there's your problem right there
> 
> What are you saying? That I should never exit a file with the cursor
> at the end? Or I should not use the documented restore-cursor code?
> 
> It is a real problem that Vim can mislead the user into thinking there
> is no difference, when in fact a new line has been inserted at the top
> of the other window. Just scrolling one window to the top is not
> enough because unless you gg in *both* windows, you have no idea
> whether the files are identical or not.

It's strange that in this case we get lots of useless "~" lines.
I wonder why that happens.  Probably the top line in the window is
computed before the fold is closed.

At least it helps a bit to set 'scrolloff' to 5 or more.
Hmm, perhaps we should add that to the defaults.

-- 
Momento mori, ergo carpe diem

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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.

Raspunde prin e-mail lui