vim-patch:8.1.0864 Make 'scrolloff' and 'sidescrolloff' options window local (#11854)

Problem: cannot have a local value for 'scrolloff' and 'sidescrolloff'

Author: Bram Moolenar

375e339007
This commit is contained in:
Will Eccles
2020-03-17 15:05:34 -04:00
committed by GitHub
parent 5a5c2f0290
commit 87d892afa0
14 changed files with 245 additions and 126 deletions

View File

@@ -65,8 +65,6 @@ describe(':set validation', function()
should_succeed('regexpengine', 2)
should_fail('report', -1, 'E487')
should_succeed('report', 0)
should_fail('scrolloff', -1, 'E49')
should_fail('sidescrolloff', -1, 'E487')
should_fail('sidescroll', -1, 'E487')
should_fail('cmdwinheight', 0, 'E487')
should_fail('updatetime', -1, 'E487')
@@ -82,6 +80,22 @@ describe(':set validation', function()
meths.set_option('window', -10)
eq(23, meths.get_option('window'))
eq('', eval("v:errmsg"))
-- 'scrolloff' and 'sidescrolloff' can have a -1 value when
-- set for the current window, but not globally
feed_command('setglobal scrolloff=-1')
eq('E487', eval("v:errmsg"):match("E%d*"))
feed_command('setglobal sidescrolloff=-1')
eq('E487', eval("v:errmsg"):match("E%d*"))
feed_command('let v:errmsg=""')
feed_command('setlocal scrolloff=-1')
eq('', eval("v:errmsg"))
feed_command('setlocal sidescrolloff=-1')
eq('', eval("v:errmsg"))
end)
it('set wmh/wh wmw/wiw checks', function()