aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/buf_functions_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-05-21 20:16:05 +0200
committerGitHub <noreply@github.com>2023-05-21 20:16:05 +0200
commit384a3bc308c95c9511eff1b85cd55357bdaedd9e (patch)
tree4ec9a0ae9095af1dbacade1e10e53a3f4d842417 /test/functional/vimscript/buf_functions_spec.lua
parentedf9a897f089191f2b43985f7ebc11a0b540bb44 (diff)
parent1fe1bb084d0099fc4f9bfdc11189485d0f74b75a (diff)
downloadrneovim-384a3bc308c95c9511eff1b85cd55357bdaedd9e.tar.gz
rneovim-384a3bc308c95c9511eff1b85cd55357bdaedd9e.tar.bz2
rneovim-384a3bc308c95c9511eff1b85cd55357bdaedd9e.zip
Merge pull request #23670 from famiu/refactor/deprecate_opt_api
refactor(options): deprecate nvim[_buf|_win]_[gs]et_option
Diffstat (limited to 'test/functional/vimscript/buf_functions_spec.lua')
-rw-r--r--test/functional/vimscript/buf_functions_spec.lua22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/functional/vimscript/buf_functions_spec.lua b/test/functional/vimscript/buf_functions_spec.lua
index 7a54f479e0..2d6d4b8e04 100644
--- a/test/functional/vimscript/buf_functions_spec.lua
+++ b/test/functional/vimscript/buf_functions_spec.lua
@@ -9,7 +9,6 @@ local meths = helpers.meths
local command = helpers.command
local exc_exec = helpers.exc_exec
local bufmeths = helpers.bufmeths
-local winmeths = helpers.winmeths
local curbufmeths = helpers.curbufmeths
local curwinmeths = helpers.curwinmeths
local curtabmeths = helpers.curtabmeths
@@ -189,7 +188,7 @@ describe('getbufline() function', function()
eq({}, funcs.getbufline(1, -1, 9999))
end)
it('returns expected lines', function()
- meths.set_option('hidden', true)
+ meths.set_option_value('hidden', true, {})
command('file ' .. fname)
curbufmeths.set_lines(0, 1, false, {'foo\0', '\0bar', 'baz'})
command('edit ' .. fname2)
@@ -269,24 +268,25 @@ describe('setbufvar() function', function()
end)
it('may set options, including window-local and global values', function()
local buf1 = meths.get_current_buf()
- eq(false, curwinmeths.get_option('number'))
+ eq(false, meths.get_option_value('number', {win=0}))
command('split')
command('new')
eq(2, bufmeths.get_number(curwinmeths.get_buf()))
funcs.setbufvar(1, '&number', true)
local windows = curtabmeths.list_wins()
- eq(false, winmeths.get_option(windows[1], 'number'))
- eq(true, winmeths.get_option(windows[2], 'number'))
- eq(false, winmeths.get_option(windows[3], 'number'))
- eq(false, winmeths.get_option(meths.get_current_win(), 'number'))
+ eq(false, meths.get_option_value('number', {win=windows[1].id}))
+ eq(true, meths.get_option_value('number', {win=windows[2].id}))
+ eq(false, meths.get_option_value('number', {win=windows[3].id}))
+ eq(false, meths.get_option_value('number', {win=meths.get_current_win().id}))
- eq(true, meths.get_option('hidden'))
+
+ eq(true, meths.get_option_value('hidden', {}))
funcs.setbufvar(1, '&hidden', 0)
- eq(false, meths.get_option('hidden'))
+ eq(false, meths.get_option_value('hidden', {}))
- eq(false, bufmeths.get_option(buf1, 'autoindent'))
+ eq(false, meths.get_option_value('autoindent', {buf=buf1.id}))
funcs.setbufvar(1, '&autoindent', true)
- eq(true, bufmeths.get_option(buf1, 'autoindent'))
+ eq(true, meths.get_option_value('autoindent', {buf=buf1.id}))
eq('Vim(call):E355: Unknown option: xxx',
exc_exec('call setbufvar(1, "&xxx", 0)'))
end)