diff options
author | Jakob Schnitzer <mail@jakobschnitzer.de> | 2017-03-26 13:20:44 +0200 |
---|---|---|
committer | Jakob Schnitzer <mail@jakobschnitzer.de> | 2017-03-30 23:04:54 +0200 |
commit | e47622f26b40d88bb8582c391df30474a64a082c (patch) | |
tree | 45ddbd232a4eb0c06d0ec5d5425ee07f53f42034 /test/functional/options/setlocal_setglobal_spec.lua | |
parent | eb0e94f71b1f44cebf7ae5c1bcff348264af6cef (diff) | |
download | rneovim-e47622f26b40d88bb8582c391df30474a64a082c.tar.gz rneovim-e47622f26b40d88bb8582c391df30474a64a082c.tar.bz2 rneovim-e47622f26b40d88bb8582c391df30474a64a082c.zip |
options: setlocal should only set local value
For 'iminsert' and 'imsearch' the global value was always changed.
Diffstat (limited to 'test/functional/options/setlocal_setglobal_spec.lua')
-rw-r--r-- | test/functional/options/setlocal_setglobal_spec.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/options/setlocal_setglobal_spec.lua b/test/functional/options/setlocal_setglobal_spec.lua new file mode 100644 index 0000000000..6902437403 --- /dev/null +++ b/test/functional/options/setlocal_setglobal_spec.lua @@ -0,0 +1,22 @@ +-- Tests for :setlocal and :setglobal + +local helpers = require('test.functional.helpers')(after_each) +local clear, execute, eval, eq, nvim = + helpers.clear, helpers.execute, helpers.eval, helpers.eq, helpers.nvim + +local function get_num_option_global(opt) + return nvim('command_output', 'setglobal ' .. opt .. '?'):match('%d+') +end + +describe(':setlocal', function() + before_each(clear) + + it('setlocal sets only local value', function() + eq('0', get_num_option_global('iminsert')) + execute('setlocal iminsert=1') + eq('0', get_num_option_global('iminsert')) + eq('0', get_num_option_global('imsearch')) + execute('setlocal imsearch=1') + eq('0', get_num_option_global('imsearch')) + end) +end) |