From 87d892afa0475644e91d9c8a57b7c35491c4dc32 Mon Sep 17 00:00:00 2001 From: Will Eccles Date: Tue, 17 Mar 2020 15:05:34 -0400 Subject: 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 https://github.com/vim/vim/commit/375e3390078e740d3c83b0c118c50d9a920036c7 --- test/functional/options/num_options_spec.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/functional/options/num_options_spec.lua b/test/functional/options/num_options_spec.lua index abb90b3b7c..4754c14f5b 100644 --- a/test/functional/options/num_options_spec.lua +++ b/test/functional/options/num_options_spec.lua @@ -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() -- cgit