diff options
Diffstat (limited to 'test/old/testdir/test_diffmode.vim')
-rw-r--r-- | test/old/testdir/test_diffmode.vim | 27 |
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 |