On 2015-09-01, Bram Moolenaar wrote:
> Patch 7.4.853
> Problem:    "zt" in diff mode does not always work properly. (Gary Johnson)
> Solution:   Don't count filler lines twice. (Christian Brabandt)
> Files:      src/move.c

>   #ifdef FEAT_DIFF
> !     /* used already contains the number of filler lines above, don't add it
> !      * again.
> !      * TODO: if filler lines above new top are to be considered as context 
> for
> !      * the current window, leave next statement commented, else hide filler
> !      * lines above cursor line, by adding them to extra */
> !     /* extra += diff_check_fill(curwin, curwin->w_cursor.lnum); */
>   #endif

Thanks for this change.  I think it would work better and as I think
"zt" should if that line was uncommented.

Even then, though, there is a bug in the behavior.  It was in
Christian's original patch, too--I just didn't notice it until I
started testing this patch.

With the cursor on the line immediately below the fill lines, "zt"
moves the line to the top of the window.  It also works when the
cursor is on the third line and farther below the fill lines.  But
when the cursor is on the second line below the fill lines, "zt"
moves the line to the middle of the window.

Here's a demonstration.

    $ vimdiff -N -u NONE -c 'set foldlevel=99' +201 <(seq 200; seq 301 500) 
<(seq 500)

The cursor should be on line 201 in the left window, which contains
the text "301".  Type zt and notice that the line with "301" moves
to the top of the window.  Move the cursor down one line to the
"302" and type zt again.  This time the line moved to the center of
the window.  Move the cursor down one line to the "303", type zt
again, and notice that the line moves to the top of the window.
Typing zt on any line containing "301" or greater correctly (IMO)
moves the line to the top of the window, _except_ for the line
containing "302".

Regards,
Gary

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