aboutsummaryrefslogtreecommitdiff
path: root/test/functional/options/num_options_spec.lua
diff options
context:
space:
mode:
authorWill Eccles <will@eccles.dev>2020-03-17 15:05:34 -0400
committerGitHub <noreply@github.com>2020-03-17 20:05:34 +0100
commit87d892afa0475644e91d9c8a57b7c35491c4dc32 (patch)
treea3d0f66e64156fbbb47864a6ed36129bd7c41318 /test/functional/options/num_options_spec.lua
parent5a5c2f0290b5cdb8ccc1a06cb41f248ab25fd792 (diff)
downloadrneovim-87d892afa0475644e91d9c8a57b7c35491c4dc32.tar.gz
rneovim-87d892afa0475644e91d9c8a57b7c35491c4dc32.tar.bz2
rneovim-87d892afa0475644e91d9c8a57b7c35491c4dc32.zip
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
Diffstat (limited to 'test/functional/options/num_options_spec.lua')
-rw-r--r--test/functional/options/num_options_spec.lua18
1 files changed, 16 insertions, 2 deletions
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()