mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
refactor(options)!: unify set_option
and set_string_option
While the interfaces for setting number and boolean options are now unified by #25394, there is still a separate `set_string_option` function that is used for setting a string option. This PR removes that function and merges it with set_option. BREAKING CHANGE: `v:option_old` is now the old global value for all global-local options, instead of just string global-local options. Local value for a global-local number/boolean option is now unset when the option is set (e.g. using `:set` or `nvim_set_option_value`) without a scope, which means they now behave the same way as string options. Ref: #25672
This commit is contained in:
@@ -1536,14 +1536,18 @@ describe('API', function()
|
||||
|
||||
-- Now try with options with a special "local is unset" value (e.g. 'undolevels')
|
||||
nvim('set_option_value', 'undolevels', 1000, {})
|
||||
eq(1000, nvim('get_option_value', 'undolevels', {scope = 'local'}))
|
||||
nvim('set_option_value', 'undolevels', 1200, {scope = 'local'})
|
||||
eq(1200, nvim('get_option_value', 'undolevels', {scope = 'local'}))
|
||||
nvim('set_option_value', 'undolevels', NIL, {scope = 'local'})
|
||||
eq(-123456, nvim('get_option_value', 'undolevels', {scope = 'local'}))
|
||||
eq(1000, nvim('get_option_value', 'undolevels', {}))
|
||||
|
||||
nvim('set_option_value', 'autoread', true, {})
|
||||
eq(true, nvim('get_option_value', 'autoread', {scope = 'local'}))
|
||||
nvim('set_option_value', 'autoread', false, {scope = 'local'})
|
||||
eq(false, nvim('get_option_value', 'autoread', {scope = 'local'}))
|
||||
nvim('set_option_value', 'autoread', NIL, {scope = 'local'})
|
||||
eq(NIL, nvim('get_option_value', 'autoread', {scope = 'local'}))
|
||||
eq(true, nvim('get_option_value', 'autoread', {}))
|
||||
end)
|
||||
|
||||
it('set window options', function()
|
||||
|
Reference in New Issue
Block a user