feat(api): add nvim_get_option_value

This commit is contained in:
Gregory Anders
2021-10-11 22:09:08 -06:00
parent 7b910a1716
commit 71ac00ccb5
9 changed files with 193 additions and 121 deletions

View File

@@ -222,9 +222,9 @@ describe('API/win', function()
eq('', nvim('get_option', 'statusline'))
command("set modified")
command("enew") -- global-local: not preserved in new buffer
eq("Failed to get value for option 'statusline'",
pcall_err(curwin, 'get_option', 'statusline'))
eq('', eval('&l:statusline')) -- confirm local value was not copied
-- confirm local value was not copied
eq('', curwin('get_option', 'statusline'))
eq('', eval('&l:statusline'))
end)
it('after switching windows #15390', function()
@@ -238,6 +238,10 @@ describe('API/win', function()
eq('window-status', window('get_option', win1, 'statusline'))
assert_alive()
end)
it('returns values for unset local options', function()
eq(-1, curwin('get_option', 'scrolloff'))
end)
end)
describe('get_position', function()