aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2022-05-11 13:49:43 +0100
committerLewis Russell <lewis6991@gmail.com>2022-05-17 14:48:10 +0100
commit6219331c4d333e5a76129746021f972c21a040db (patch)
tree29938b911e1164f4757306cd6fcceaf1f9bcd709 /test/functional/api/vim_spec.lua
parent6613f58cebde7db4e69709b84d511c32a7c4ce32 (diff)
downloadrneovim-6219331c4d333e5a76129746021f972c21a040db.tar.gz
rneovim-6219331c4d333e5a76129746021f972c21a040db.tar.bz2
rneovim-6219331c4d333e5a76129746021f972c21a040db.zip
feat(api): add win and buf to nvim_set_option_value
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index ba170ba8c5..8c4048132c 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()