From 611b43369e73b0da799226f70a6821c0c31ca222 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 25 Jul 2022 19:12:06 +0800 Subject: vim-patch:8.2.5155: in diff mode windows may get out of sync Problem: In diff mode windows may get out of sync. (Gary Johnson) Solution: Avoid that the other window scrolls for 'cursorbind'. https://github.com/vim/vim/commit/a315ce1f326b836167ca8b1037dafd93eb8d4d4e --- test/functional/ui/diff_spec.lua | 89 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) (limited to 'test/functional/ui/diff_spec.lua') diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua index 5d056cd6c3..36dc5addcd 100644 --- a/test/functional/ui/diff_spec.lua +++ b/test/functional/ui/diff_spec.lua @@ -6,6 +6,7 @@ local clear = helpers.clear local command = helpers.command local insert = helpers.insert local write_file = helpers.write_file +local dedent = helpers.dedent local exec = helpers.exec describe('Diff mode screen', function() @@ -985,6 +986,93 @@ int main(int argc, char **argv) ]]) end) end) + + -- oldtest: Test_diff_scroll() + -- This was scrolling for 'cursorbind' but 'scrollbind' is more important + it('scrolling works correctly vim-patch:8.2.5155', function() + screen:try_resize(40, 12) + write_file(fname, dedent([[ + line 1 + line 2 + line 3 + line 4 + + // Common block + // one + // containing + // four lines + + // Common block + // two + // containing + // four lines]]), false) + write_file(fname_2, dedent([[ + line 1 + line 2 + line 3 + line 4 + + Lorem + ipsum + dolor + sit + amet, + consectetur + adipiscing + elit. + Etiam + luctus + lectus + sodales, + dictum + + // Common block + // one + // containing + // four lines + + Vestibulum + tincidunt + aliquet + nulla. + + // Common block + // two + // containing + // four lines]]), false) + reread() + + feed('jjjj') + screen:expect([[ + {1: }line 1 │{1: }line 1 | + {1: }line 2 │{1: }line 2 | + {1: }line 3 │{1: }line 3 | + {1: }line 4 │{1: }line 4 | + {1: } │{1: }^ | + {1: }{2:-----------------}│{1: }{4:Lorem }| + {1: }{2:-----------------}│{1: }{4:ipsum }| + {1: }{2:-----------------}│{1: }{4:dolor }| + {1: }{2:-----------------}│{1: }{4:sit }| + {1: }{2:-----------------}│{1: }{4:amet, }| + {3: