aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-27 08:55:59 +0800
committerGitHub <noreply@github.com>2023-06-27 08:55:59 +0800
commit2e055e49a3ae27db641986650aa9e7b2b962cf63 (patch)
tree421d42a6c3d86e11cf37af09175ccb789c069214 /test/functional/legacy
parent0ca2d11c1f473d9924c261c9dbd4e38730932bb4 (diff)
parent116b09ac0495f07cb42a0b034622b6122d4ea0f8 (diff)
downloadrneovim-2e055e49a3ae27db641986650aa9e7b2b962cf63.tar.gz
rneovim-2e055e49a3ae27db641986650aa9e7b2b962cf63.tar.bz2
rneovim-2e055e49a3ae27db641986650aa9e7b2b962cf63.zip
Merge pull request #24170 from zeertzjq/vim-9.0.1664
vim-patch:9.0.{1664,1667}: divide by zero when scrolling with 'smoothscroll' set
Diffstat (limited to 'test/functional/legacy')
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index 3b755ff3e8..ae6a409762 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -939,6 +939,49 @@ describe('smoothscroll', function()
]])
end)
+ -- oldtest: Test_smoothscroll_zero_width_scroll_cursor_bot()
+ it('does not divide by zero in zero-width window', function()
+ screen:try_resize(40, 19)
+ screen:set_default_attr_ids({
+ [1] = {foreground = Screen.colors.Brown}; -- LineNr
+ [2] = {bold = true, foreground = Screen.colors.Blue}; -- NonText
+ [3] = {bold = true, reverse = true}; -- StatusLine
+ [4] = {reverse = true}; -- StatusLineNC
+ })
+ exec([[
+ silent normal yy
+ silent normal 19p
+ set cpoptions+=n
+ vsplit
+ vertical resize 0
+ set foldcolumn=1
+ set number
+ set smoothscroll
+ silent normal 20G
+ ]])
+ screen:expect([[
+ {1: }│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:@}│ |
+ {2:^@}│ |
+ {3:< }{4:[No Name] [+] }|
+ |
+ ]])
+ end)
+
it("works with virt_lines above and below", function()
screen:try_resize(55, 7)
exec([=[