mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
vim-patch:9.1.1385: inefficient loop for 'nosmoothscroll' scrolling (#33992)
Problem: Loop that ensures "w_skipcol" is zero with 'nosmoothscroll' for (half)-page scrolling is inefficient. Solution: Calculate the required "count" instead of looping until "w_skipcol" is zero (Luuk van Baal).acf0ebe8a8
(cherry picked from commitd539a952da
) --------- Co-authored-by: luukvbaal <luukvbaal@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
![175700243+neovim-backports[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
GitHub

parent
3e83a33108
commit
f623fad9c4
@@ -4339,4 +4339,13 @@ func Test_scroll_longline_scrolloff()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Benchmark test for Ctrl-F with 'nosmoothscroll'
|
||||
func Test_scroll_longline_benchmark()
|
||||
call setline(1, ['foo'->repeat(20000)] + [''])
|
||||
let start = reltime()
|
||||
exe "normal! \<C-F>"
|
||||
call assert_inrange(0, 0.1, reltimefloat(reltime(start)))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab nofoldenable
|
||||
|
Reference in New Issue
Block a user