John Beckett wrote:

> On Sunday, August 28, 2016 at 10:40:05 PM UTC+10, Bram Moolenaar wrote:
> > John Beckett wrote:
> >> 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.
> 
> Thanks Bram for patch 7.4.2279, that's much better.
> However, the following shows there is still a frustration.
> 
> Using gvim.exe 7.4.2290
> 
> Start Vim then execute the commands shown.
> 
> gvim -N -u NONE
> 
> :let lines = range(1, 999)
> :call writefile(lines, 'old.tmp')
> :call writefile(['inserted'] + lines, 'new.tmp')
> :e new.tmp
> :vert diffs old.tmp
> 
> One way to execute the commands is to copy the lines to the
> clipboard. In Vim, type @+
> 
> Result: See two windows side-by-side. They appear to be
> identical, with each window showing:
> 
> 1
> 2
> 3
> 4
> 5
> 6
> +--993 lines: 7------
> 
> The cursor is on "1" at the top of the left-hand window.
> Pressing [c does nothing other than ring the bell. The only way
> I know to see that the two files are different is to switch to
> the right-hand window and scroll up ([c works).
> 
> I'm never confident any more that a diff is showing everything.

For me, when the files are identical I would not see any lines of text,
only the closed fold.  Perhaps your setting is to always open the fold
under the cursor?

That filler lines may hide above the window is hard to avoid.  We can't
disallow scrolling the window into that position.  Scrolling one line
down to reveal one filler line is not so easy in general, would only
work in some situations.  E.g. when the line wraps in the other window
it may completely fill the window and the cursor line can't be
displayed.

-- 
Contrary to popular belief, Unix is user friendly.
It just happens to be selective about who it makes friends with.
                                               -- Dave Parnas

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