diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2021-12-04 14:30:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-04 14:30:27 -0700 |
commit | 1e6eeca9d1360554ee18525603e83c3a1999a622 (patch) | |
tree | 74bdad7d2506a0a93d112230fe9c3bf1f8652675 /test/functional/api/vim_spec.lua | |
parent | 222ef0c00d97aa2d5e17ca6b14aea037155595ee (diff) | |
parent | 71ac00ccb523383411b907b5fdf00a376e24a6f0 (diff) | |
download | rneovim-1e6eeca9d1360554ee18525603e83c3a1999a622.tar.gz rneovim-1e6eeca9d1360554ee18525603e83c3a1999a622.tar.bz2 rneovim-1e6eeca9d1360554ee18525603e83c3a1999a622.zip |
Merge pull request #15996 from gpanders/nvim_get_option_value
feat(api): add nvim_{get,set}_option_value
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 21de4925b5..d53208a915 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -949,6 +949,33 @@ describe('API', function() end) end) + describe('nvim_get_option_value, nvim_set_option_value', function() + it('works', function() + ok(nvim('get_option_value', 'equalalways', {})) + nvim('set_option_value', 'equalalways', false, {}) + ok(not nvim('get_option_value', 'equalalways', {})) + end) + + it('can get local values when global value is set', function() + eq(0, nvim('get_option_value', 'scrolloff', {})) + eq(-1, nvim('get_option_value', 'scrolloff', {scope = 'local'})) + end) + + it('can set global and local values', function() + nvim('set_option_value', 'makeprg', 'hello', {}) + eq('hello', nvim('get_option_value', 'makeprg', {})) + eq('', nvim('get_option_value', 'makeprg', {scope = 'local'})) + nvim('set_option_value', 'makeprg', 'world', {scope = 'local'}) + eq('world', nvim('get_option_value', 'makeprg', {scope = 'local'})) + nvim('set_option_value', 'makeprg', 'goodbye', {scope = 'global'}) + eq('goodbye', nvim('get_option_value', 'makeprg', {scope = 'global'})) + nvim('set_option_value', 'makeprg', 'hello', {}) + eq('hello', nvim('get_option_value', 'makeprg', {scope = 'global'})) + eq('hello', nvim('get_option_value', 'makeprg', {})) + eq('', nvim('get_option_value', 'makeprg', {scope = 'local'})) + end) + end) + describe('nvim_{get,set}_current_buf, nvim_list_bufs', function() it('works', function() eq(1, #nvim('list_bufs')) |