aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/mouse_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-23 12:14:16 +0800
committerGitHub <noreply@github.com>2022-11-23 12:14:16 +0800
commitf1b88ced07a5dcc62cd847cade2ed97e23fffbf9 (patch)
treea0f39df580c605910ef542d5e7cd3ce651f2742e /test/functional/ui/mouse_spec.lua
parent4571ba4d0a5234408e544c3a98f107688a792f0d (diff)
downloadrneovim-f1b88ced07a5dcc62cd847cade2ed97e23fffbf9.tar.gz
rneovim-f1b88ced07a5dcc62cd847cade2ed97e23fffbf9.tar.bz2
rneovim-f1b88ced07a5dcc62cd847cade2ed97e23fffbf9.zip
fix(options): fix local 'sidescrolloff' doesn't work for mouse (#21162)
Missing part of Vim patch 8.1.0864.
Diffstat (limited to 'test/functional/ui/mouse_spec.lua')
-rw-r--r--test/functional/ui/mouse_spec.lua43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index b3ea0edb12..f705678bd5 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -968,6 +968,49 @@ describe('ui/mouse/input', function()
]])
end)
+ it("'sidescrolloff' applies to horizontal scrolling", function()
+ command('set nowrap')
+ command('set sidescrolloff=4')
+
+ feed("I <esc>020ib<esc>0")
+ screen:expect([[
+ testing |
+ mouse |
+ ^bbbbbbbbbbbbbbbbbbbb supp|
+ {0:~ }|
+ |
+ ]])
+
+ meths.input_mouse('wheel', 'right', '', 0, 0, 27)
+ screen:expect([[
+ g |
+ |
+ bbbb^bbbbbbbbbb support an|
+ {0:~ }|
+ |
+ ]])
+
+ -- window-local 'sidescrolloff' should override global value. #21162
+ command('setlocal sidescrolloff=2')
+ feed('0')
+ screen:expect([[
+ testing |
+ mouse |
+ ^bbbbbbbbbbbbbbbbbbbb supp|
+ {0:~ }|
+ |
+ ]])
+
+ meths.input_mouse('wheel', 'right', '', 0, 0, 27)
+ screen:expect([[
+ g |
+ |
+ bb^bbbbbbbbbbbb support an|
+ {0:~ }|
+ |
+ ]])
+ end)
+
describe('on concealed text', function()
-- Helpful for reading the test expectations:
-- :match Error /\^/