mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
vim-patch:9.1.1297: Ctrl-D scrolling can get stuck #33453
Problem: cursor_correct() calculates a valid cursor position which is later changed by update_topline() and causes Ctrl-D scrolling to be stuck (Daniel Steinberg, after v9.1.0258). Solution: Update the valid cursor position before validating topline (Luuk van Baal).c98250377d
(cherry picked from commitaa47c8efa9
)
This commit is contained in:
committed by
github-actions[bot]
parent
0c2bf55e90
commit
3e83a33108
@ -2333,6 +2333,7 @@ void cursor_correct(win_T *wp)
|
||||
~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW);
|
||||
}
|
||||
}
|
||||
check_cursor_moved(wp);
|
||||
wp->w_valid |= VALID_TOPLINE;
|
||||
wp->w_viewport_invalid = true;
|
||||
}
|
||||
|
@ -4320,4 +4320,23 @@ func Test_normal_go()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for Ctrl-D with 'scrolloff' and narrow window does not get stuck.
|
||||
func Test_scroll_longline_scrolloff()
|
||||
11new
|
||||
36vsplit
|
||||
set scrolloff=5
|
||||
|
||||
call setline(1, ['']->repeat(5))
|
||||
call setline(6, ['foo'->repeat(20)]->repeat(2))
|
||||
call setline(8, ['bar'->repeat(30)])
|
||||
call setline(9, ['']->repeat(5))
|
||||
exe "normal! \<C-D>"
|
||||
call assert_equal(6, line('w0'))
|
||||
exe "normal! \<C-D>"
|
||||
call assert_equal(7, line('w0'))
|
||||
|
||||
set scrolloff&
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab nofoldenable
|
||||
|
Reference in New Issue
Block a user