diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-05-25 17:05:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 17:05:28 +0200 |
commit | 24352cba01395aeb1c29b651b6d06f472e0911d3 (patch) | |
tree | 7db56adbee1bfbde6b71cf367de5d42eb6acf127 /test/functional/api/vim_spec.lua | |
parent | 802a23926d237139822dda0ab712de3e1a98e5f9 (diff) | |
parent | 6219331c4d333e5a76129746021f972c21a040db (diff) | |
download | rneovim-24352cba01395aeb1c29b651b6d06f472e0911d3.tar.gz rneovim-24352cba01395aeb1c29b651b6d06f472e0911d3.tar.bz2 rneovim-24352cba01395aeb1c29b651b6d06f472e0911d3.zip |
Merge pull request #18528 from lewis6991/setwinopt
feat(api): add `win` and `buf` to `nvim_set_option_value`
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index c5e8cfee23..55535a92e5 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1439,6 +1439,24 @@ describe('API', function() nvim('set_option_value', 'autoread', NIL, {scope = 'local'}) eq(NIL, nvim('get_option_value', 'autoread', {scope = 'local'})) end) + + it('set window options', function() + -- Same as to nvim_win_set_option + nvim('set_option_value', 'colorcolumn', '4,3', {win=0}) + eq('4,3', nvim('get_option_value', 'colorcolumn', {scope = 'local'})) + command("set modified hidden") + command("enew") -- edit new buffer, window option is preserved + eq('4,3', nvim('get_option_value', 'colorcolumn', {scope = 'local'})) + end) + + 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'})) + command("set modified hidden") + command("enew") -- edit new buffer, window option is reset + eq('', nvim('get_option_value', 'colorcolumn', {scope = 'local'})) + end) end) describe('nvim_{get,set}_current_buf, nvim_list_bufs', function() |