mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +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:
@@ -620,4 +620,30 @@ describe('smoothscroll', function()
|
||||
feed('0')
|
||||
screen:expect(s1)
|
||||
end)
|
||||
|
||||
-- oldtest: Test_smoothscroll_zero_width()
|
||||
it("does not divide by zero with a narrow window", function()
|
||||
screen:try_resize(12, 2)
|
||||
screen:set_default_attr_ids({
|
||||
[1] = {foreground = Screen.colors.Brown},
|
||||
[2] = {foreground = Screen.colors.Blue1, bold = true},
|
||||
})
|
||||
exec([[
|
||||
call setline(1, ['a'->repeat(100)])
|
||||
set wrap smoothscroll number laststatus=0
|
||||
wincmd v
|
||||
wincmd v
|
||||
wincmd v
|
||||
wincmd v
|
||||
]])
|
||||
screen:expect([[
|
||||
{1: 1^ }│{1: }│{1: }│{1: }│{1: }|
|
||||
|
|
||||
]])
|
||||
feed('llllllllll<C-W>o')
|
||||
screen:expect([[
|
||||
{2:<<<}{1: }aa^aaaaaa|
|
||||
|
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user