mirror of
https://github.com/neovim/neovim.git
synced 2026-03-21 16:09:42 +00:00
test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value
`nvim_(get|set)_option_value` pick the current buffer / window by default for buffer-local/window-local (but not global-local) options. So specifying `buf = 0` or `win = 0` in opts is unnecessary for those options. This PR removes those to reduce code clutter.
This commit is contained in:
@@ -1397,7 +1397,7 @@ describe('API', function()
|
||||
it('works to set global value of local options', function()
|
||||
nvim('set_option_value', 'lisp', true, {scope='global'})
|
||||
eq(true, nvim('get_option_value', 'lisp', {scope='global'}))
|
||||
eq(false, nvim('get_option_value', 'lisp', {buf=0}))
|
||||
eq(false, nvim('get_option_value', 'lisp', {}))
|
||||
eq(nil, nvim('command_output', 'setglobal lisp?'):match('nolisp'))
|
||||
eq('nolisp', nvim('command_output', 'setlocal lisp?'):match('nolisp'))
|
||||
nvim('set_option_value', 'shiftwidth', 20, {scope='global'})
|
||||
@@ -1493,7 +1493,7 @@ describe('API', function()
|
||||
end)
|
||||
|
||||
it('set window options', function()
|
||||
nvim('set_option_value', 'colorcolumn', '4,3', {win=0})
|
||||
nvim('set_option_value', 'colorcolumn', '4,3', {})
|
||||
eq('4,3', nvim('get_option_value', 'colorcolumn', {scope = 'local'}))
|
||||
command("set modified hidden")
|
||||
command("enew") -- edit new buffer, window option is preserved
|
||||
|
||||
Reference in New Issue
Block a user