vim-patch:9.1.0280: several issues with 'smoothscroll' support

Problem:  Logic to make sure cursor is in visible part of the screen after
          scrolling the text with 'smoothscroll' is scattered, asymmetric
          and contains bugs.
Solution: Adjust and create helper function for 'smoothscroll' cursor logic.
          (Luuk van Baal)

9148ba8a46
This commit is contained in:
Luuk van Baal
2024-04-08 22:40:55 +02:00
parent e21423bb35
commit 8f5fd0884b
6 changed files with 213 additions and 174 deletions

View File

@@ -1772,4 +1772,19 @@ func Test_diff_toggle_wrap_skipcol_leftcol()
\ screenpos(win2, line('.', win2), col('.', win2)))
bwipe!
bwipe!
endfunc
" Ctrl-D reveals filler lines below the last line in the buffer.
func Test_diff_eob_halfpage()
5new
call setline(1, ['']->repeat(10) + ['a'])
diffthis
5new
call setline(1, ['']->repeat(3) + ['a', 'b'])
diffthis
wincmd j
exe "norm! G\<C-D>"
call assert_equal(6, line('w0'))
%bwipe!