comparison src/testdir/test_diffmode.vim @ 33454:b91aeab2d62e v9.0.1981

patch 9.0.1981: not being able to scroll up in diff mode Commit: https://github.com/vim/vim/commit/0583491277dea9d14e000051c26405b90d839072 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Oct 4 20:12:37 2023 +0200 patch 9.0.1981: not being able to scroll up in diff mode Problem: Cannot scroll up in diff mode with many filler lines and zero 'scrolloff'. Solution: Invalidate w_cline_row before calling comp_botline(). closes: #13256 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author Christian Brabandt <cb@256bit.org>
date Wed, 04 Oct 2023 20:15:04 +0200
parents 9c6bc59b6d80
children 3d0544e31ca5
comparison
equal deleted inserted replaced
33453:495fbedef23c 33454:b91aeab2d62e
1612 redraw 1612 redraw
1613 normal! jj 1613 normal! jj
1614 call assert_equal(1, winsaveview().topline) 1614 call assert_equal(1, winsaveview().topline)
1615 normal! j 1615 normal! j
1616 call assert_equal(2, winsaveview().topline) 1616 call assert_equal(2, winsaveview().topline)
1617
1618 bwipe!
1619 bwipe!
1620 endfunc
1621
1622 func Test_diff_scroll_many_filler()
1623 20new
1624 vnew
1625 call setline(1, ['^^^', '^^^', '$$$', '$$$'])
1626 diffthis
1627 setlocal scrolloff=0
1628 wincmd p
1629 call setline(1, ['^^^', '^^^'] + repeat(['###'], 41) + ['$$$', '$$$'])
1630 diffthis
1631 setlocal scrolloff=0
1632 wincmd p
1633 redraw
1634
1635 " Note: need a redraw after each scroll, otherwise the test always passes.
1636 normal! G
1637 redraw
1638 call assert_equal(3, winsaveview().topline)
1639 call assert_equal(18, winsaveview().topfill)
1640 exe "normal! \<C-B>"
1641 redraw
1642 call assert_equal(3, winsaveview().topline)
1643 call assert_equal(19, winsaveview().topfill)
1644 exe "normal! \<C-B>"
1645 redraw
1646 call assert_equal(2, winsaveview().topline)
1647 call assert_equal(0, winsaveview().topfill)
1648 exe "normal! \<C-B>"
1649 redraw
1650 call assert_equal(1, winsaveview().topline)
1651 call assert_equal(0, winsaveview().topfill)
1652
1617 bwipe! 1653 bwipe!
1618 bwipe! 1654 bwipe!
1619 endfunc 1655 endfunc
1620 1656
1621 " This was trying to update diffs for a buffer being closed 1657 " This was trying to update diffs for a buffer being closed