diff options
author | Gregory Anders <greg@gpanders.com> | 2022-06-20 08:20:06 -0600 |
---|---|---|
committer | Gregory Anders <greg@gpanders.com> | 2022-06-20 09:16:21 -0600 |
commit | 58d028f64bb0ddc80b6201906880182d14ad9a3c (patch) | |
tree | 2c68a97dd4101016b8a7cc3357f8bfdbc5d69153 /test/functional/api/vim_spec.lua | |
parent | 605631ac2992176f7286409320a9971bb5b9cd69 (diff) | |
download | rneovim-58d028f64bb0ddc80b6201906880182d14ad9a3c.tar.gz rneovim-58d028f64bb0ddc80b6201906880182d14ad9a3c.tar.bz2 rneovim-58d028f64bb0ddc80b6201906880182d14ad9a3c.zip |
feat(api): add "buf" and "win" to nvim_get_option_value
These mirror their counterparts in nvim_set_option_value.
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index ea5725d836..ef6798dea3 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1453,10 +1453,21 @@ describe('API', function() it('set local window options', function() -- Different to nvim_win_set_option nvim('set_option_value', 'colorcolumn', '4,3', {win=0, scope='local'}) - eq('4,3', nvim('get_option_value', 'colorcolumn', {scope = 'local'})) + eq('4,3', nvim('get_option_value', 'colorcolumn', {win = 0, scope = 'local'})) command("set modified hidden") command("enew") -- edit new buffer, window option is reset - eq('', nvim('get_option_value', 'colorcolumn', {scope = 'local'})) + eq('', nvim('get_option_value', 'colorcolumn', {win = 0, scope = 'local'})) + end) + + it('get buffer or window-local options', function() + nvim('command', 'new') + local buf = nvim('get_current_buf').id + nvim('buf_set_option', buf, 'tagfunc', 'foobar') + eq('foobar', nvim('get_option_value', 'tagfunc', {buf = buf})) + + local win = nvim('get_current_win').id + nvim('win_set_option', win, 'number', true) + eq(true, nvim('get_option_value', 'number', {win = win})) end) end) |