From bee19c22d569e54513a9c591441c7f411811dc81 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 04:10:58 +0200 Subject: Adding upstream version 2:9.1.0374. Signed-off-by: Daniel Baumann --- src/testdir/test_diffmode.vim | 62 +++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 20 deletions(-) (limited to 'src/testdir/test_diffmode.vim') diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index 7602bd3..098d5d0 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -1647,36 +1647,39 @@ endfunc func Test_diff_scroll_many_filler() 20new vnew - call setline(1, ['^^^', '^^^', '$$$', '$$$']) + call setline(1, range(1, 40)) diffthis setlocal scrolloff=0 wincmd p - call setline(1, ['^^^', '^^^'] + repeat(['###'], 41) + ['$$$', '$$$']) + call setline(1, range(1, 20)->reverse() + ['###']->repeat(41) + range(21, 40)->reverse()) diffthis setlocal scrolloff=0 wincmd p redraw " Note: need a redraw after each scroll, otherwise the test always passes. - normal! G - redraw - call assert_equal(3, winsaveview().topline) - call assert_equal(18, winsaveview().topfill) - exe "normal! \" - redraw - call assert_equal(3, winsaveview().topline) - call assert_equal(19, winsaveview().topfill) - exe "normal! \" - redraw - call assert_equal(2, winsaveview().topline) - call assert_equal(0, winsaveview().topfill) - exe "normal! \" - redraw - call assert_equal(1, winsaveview().topline) - call assert_equal(0, winsaveview().topfill) + for _ in range(2) + normal! G + redraw + call assert_equal(40, winsaveview().topline) + call assert_equal(19, winsaveview().topfill) + exe "normal! \" + redraw + call assert_equal(22, winsaveview().topline) + call assert_equal(0, winsaveview().topfill) + exe "normal! \" + redraw + call assert_equal(4, winsaveview().topline) + call assert_equal(0, winsaveview().topfill) + exe "normal! \" + redraw + call assert_equal(1, winsaveview().topline) + call assert_equal(0, winsaveview().topfill) + set smoothscroll + endfor - bwipe! - bwipe! + set smoothscroll& + %bwipe! endfunc " This was trying to update diffs for a buffer being closed @@ -2020,4 +2023,23 @@ func Test_diff_toggle_wrap_skipcol_leftcol() bwipe! endfunc +" Ctrl-D reveals filler lines below the last line in the buffer. +func Test_diff_eob_halfpage() + new + call setline(1, ['']->repeat(10) + ['a']) + diffthis + new + call setline(1, ['']->repeat(3) + ['a', 'b']) + diffthis + resize 5 + wincmd j + resize 5 + norm G + call assert_equal(7, line('w0')) + exe "norm! \" + call assert_equal(8, line('w0')) + + %bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit v1.2.3