mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
fix(options): fix local 'sidescrolloff' doesn't work for mouse (#21162)
Missing part of Vim patch 8.1.0864.
This commit is contained in:
@@ -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 /\^/
|
||||
|
||||
Reference in New Issue
Block a user