forked from aniani/vim
patch 9.1.0413: smoothscroll may cause infinite loop
Problem: smoothscroll may cause infinite loop, with
very narrow windows
(Jaehwang Jung, after v9.1.0280)
Solution: Check for width1 being negative, verify
that win_linetabsize does not overflow
fixes: #14750
closes: #14772
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -4268,4 +4268,14 @@ func Test_halfpage_longline()
|
||||
call assert_equal(2, line('.'))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for Ctrl-E with long line and very narrow window,
|
||||
" used to cause an inifite loop
|
||||
func Test_scroll_longline_no_loop()
|
||||
4vnew
|
||||
setl smoothscroll number showbreak=> scrolloff=2
|
||||
call setline(1, repeat(['Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'], 3))
|
||||
exe "normal! \<C-E>"
|
||||
bwipe!
|
||||
endfunc
|
||||
" vim: shiftwidth=2 sts=2 expandtab nofoldenable
|
||||
|
||||
Reference in New Issue
Block a user