mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 15:08:35 +00:00
vim-patch:9.0.1247: divide by zero with 'smoothscroll' set and a narrow window
Problem: Divide by zero with 'smoothscroll' set and a narrow window.
Solution: Bail out when the window is too narrow.
870219c58c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -577,5 +577,32 @@ func Test_smoothscroll_mouse_pos()
|
||||
"let &ttymouse = save_ttymouse
|
||||
endfunc
|
||||
|
||||
" this was dividing by zero
|
||||
func Test_smoothscrol_zero_width()
|
||||
CheckScreendump
|
||||
|
||||
let lines =<< trim END
|
||||
winsize 0 0
|
||||
vsplit
|
||||
vsplit
|
||||
vsplit
|
||||
vsplit
|
||||
vsplit
|
||||
sil norm H
|
||||
set wrap
|
||||
set smoothscroll
|
||||
set number
|
||||
END
|
||||
call writefile(lines, 'XSmoothScrollZero', 'D')
|
||||
let buf = RunVimInTerminal('-u NONE -i NONE -n -m -X -Z -e -s -S XSmoothScrollZero', #{rows: 6, cols: 60, wait_for_ruler: 0})
|
||||
call TermWait(buf, 3000)
|
||||
call VerifyScreenDump(buf, 'Test_smoothscroll_zero_1', {})
|
||||
|
||||
call term_sendkeys(buf, ":sil norm \<C-V>\<C-W>\<C-V>\<C-N>\<CR>")
|
||||
call VerifyScreenDump(buf, 'Test_smoothscroll_zero_2', {})
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Reference in New Issue
Block a user