summaryrefslogtreecommitdiff
path: root/src/testdir/test_diffmode.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-06-24 12:38:57 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-24 12:38:57 +0100
commita315ce1f326b836167ca8b1037dafd93eb8d4d4e (patch)
tree9d507a8fb914f12e7582dcc77d3a605c39d24cd1 /src/testdir/test_diffmode.vim
parenta57b553b432855667c9f26edfad95ccfdd24a6b7 (diff)
downloadvim-git-a315ce1f326b836167ca8b1037dafd93eb8d4d4e.tar.gz
patch 8.2.5155: in diff mode windows may get out of syncv8.2.5155
Problem: In diff mode windows may get out of sync. (Gary Johnson) Solution: Avoid that the other window scrolls for 'cursorbind'.
Diffstat (limited to 'src/testdir/test_diffmode.vim')
-rw-r--r--src/testdir/test_diffmode.vim69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index a632b19bc..03c6c798e 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -1535,4 +1535,73 @@ func Test_diff_foldinvert()
set scrollbind&
endfunc
+" This was scrolling for 'cursorbind' but 'scrollbind' is more important
+func Test_diff_scroll()
+ CheckScreendump
+
+ let left =<< trim END
+ line 1
+ line 2
+ line 3
+ line 4
+
+ // Common block
+ // one
+ // containing
+ // four lines
+
+ // Common block
+ // two
+ // containing
+ // four lines
+ END
+ call writefile(left, 'Xleft')
+ let right =<< trim END
+ 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
+ END
+ call writefile(right, 'Xright')
+ let buf = RunVimInTerminal('-d Xleft Xright', {'rows': 12})
+ call term_sendkeys(buf, "\<C-W>\<C-W>jjjj")
+ call VerifyScreenDump(buf, 'Test_diff_scroll_1', {})
+ call term_sendkeys(buf, "j")
+ call VerifyScreenDump(buf, 'Test_diff_scroll_2', {})
+
+ call StopVimInTerminal(buf)
+ call delete('Xleft')
+ call delete('Xright')
+endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab