aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_diffmode.vim
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-25 19:15:05 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-11-25 19:27:38 +0000
commitc5d770d311841ea5230426cc4c868e8db27300a8 (patch)
treedd21f70127b4b8b5f109baefc8ecc5016f507c91 /test/old/testdir/test_diffmode.vim
parent9be89f131f87608f224f0ee06d199fcd09d32176 (diff)
parent081beb3659bd6d8efc3e977a160b1e72becbd8a2 (diff)
downloadrneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.gz
rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.bz2
rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/old/testdir/test_diffmode.vim')
-rw-r--r--test/old/testdir/test_diffmode.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/old/testdir/test_diffmode.vim b/test/old/testdir/test_diffmode.vim
index a448ed9b7f..880286d329 100644
--- a/test/old/testdir/test_diffmode.vim
+++ b/test/old/testdir/test_diffmode.vim
@@ -2007,4 +2007,31 @@ func Test_diff_overlapped_diff_blocks_will_be_merged()
call StopVimInTerminal(buf)
endfunc
+" switching windows in diff mode caused an unnecessary scroll
+func Test_diff_topline_noscroll()
+ CheckScreendump
+
+ let content =<< trim END
+ call setline(1, range(1,60))
+ vnew
+ call setline(1, range(1,10) + range(50,60))
+ windo diffthis
+ norm! G
+ exe "norm! 30\<C-y>"
+ END
+ call writefile(content, 'Xcontent', 'D')
+ let buf = RunVimInTerminal('-S Xcontent', {'rows': 20})
+ call VerifyScreenDump(buf, 'Test_diff_topline_1', {})
+ call term_sendkeys(buf, ":echo line('w0', 1001)\<cr>")
+ call term_wait(buf)
+ call VerifyScreenDump(buf, 'Test_diff_topline_2', {})
+ call term_sendkeys(buf, "\<C-W>p")
+ call term_wait(buf)
+ call VerifyScreenDump(buf, 'Test_diff_topline_3', {})
+ call term_sendkeys(buf, "\<C-W>p")
+ call term_wait(buf)
+ call VerifyScreenDump(buf, 'Test_diff_topline_4', {})
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab