Gary Johnson wrote:

> I've noticed for a while when diffing two versions of a file that
> the two windows sometimes get out of sync.  I created and attached
> two files that exhibit this problem.  For this example, I ran vim
> version 8.2.5154 in an 80x24 xterm.
> 
> Steps to reproduce
> 
>  1. Save the attached files to disk.
>  2. Start vim as
> 
>         $ vimdiff -N -u NONE -i NONE demo_left demo_right
> 
>     The display initially looks fine.
>  3. Move the cursor to the right window:
> 
>         <C-W><C-W>
> 
>  4. Move the cursor down five lines:
> 
>         jjjjj
> 
>     Note that when the cursor reaches the fifth line 6, containing
>     "Lorem", the left window scrolls to display common block one in
>     roughly the center while the right window remains unchanged,
>     like this.  (I removed eight columns from each window to make it
>     fit in the width of a standard email page.)
> 
>       ------------------------------|  line 1
>       ------------------------------|  line 2
>       ------------------------------|  line 3
>       ------------------------------|  line 4
>       ------------------------------|
>       ------------------------------|  Lorem
>       ------------------------------|  ipsum
>       ------------------------------|  dolor
>       ------------------------------|  sit
>       ------------------------------|  amet,
>       // Common block               |  consectetur
>       // one                        |  adipiscing
>       // containing                 |  elit.
>       // four lines                 |  Etiam
>                                     |  luctus
>       ------------------------------|  lectus
>       ------------------------------|  sodales,
>       ------------------------------|  dictum
>       ------------------------------|  augue
>       ------------------------------|  vel,
>       ------------------------------|  molestie
>       ------------------------------|  augue.
>     demo_left         6,1        85% demo_right       6,1        Top
> 
>  5. Move the cursor down to the bottom of the window and one line
>     more.  The right window scrolls one line as expected and the
>     left window scrolls to align itself properly with the right
>     window.
> 
>  6. Use the j key to move further down in the right buffer and more
>     odd things happen, as when the cursor moves to line 39,
>     containing "Vestibulum".  The left window scrolls to show the
>     last 3 lines of common block one at the top and the first line
>     of common block two at the bottom.
> 
> Expected behavior
> 
>     I expect the left window to remain in sync with the right
>     window, displaying common buffer lines on the same screen line.

Thanks for providing a good repro case.  The window height also matters,
it must not have too many lines.

I'll fix it.  Please check for any places that then might fail, the
rules about 'scrollbind' and 'cursorbind' are tricky.

-- 
EXPERIENCE - experience is a wonderful thing. It enables you to 
recognise a mistake when you make it again.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220624113924.C4E191C4808%40moolenaar.net.

Raspunde prin e-mail lui