mirror of
https://github.com/neovim/neovim.git
synced 2026-03-24 17:40:59 +00:00
api: Replace set_var(name, NIL) with del_var(name)
This commit is contained in:
@@ -5,6 +5,8 @@ local clear, nvim, curbuf, curbuf_contents, window, curwin, eq, neq,
|
||||
helpers.curbuf_contents, helpers.window, helpers.curwin, helpers.eq,
|
||||
helpers.neq, helpers.ok, helpers.feed, helpers.insert, helpers.eval
|
||||
local wait = helpers.wait
|
||||
local curwinmeths = helpers.curwinmeths
|
||||
local funcs = helpers.funcs
|
||||
|
||||
-- check if str is visible at the beginning of some line
|
||||
local function is_visible(str)
|
||||
@@ -126,11 +128,14 @@ describe('window_* functions', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('{get,set}_var', function()
|
||||
describe('{get,set,del}_var', function()
|
||||
it('works', function()
|
||||
curwin('set_var', 'lua', {1, 2, {['3'] = 1}})
|
||||
eq({1, 2, {['3'] = 1}}, curwin('get_var', 'lua'))
|
||||
eq({1, 2, {['3'] = 1}}, nvim('eval', 'w:lua'))
|
||||
eq(1, funcs.exists('w:lua'))
|
||||
curwinmeths.del_var('lua')
|
||||
eq(0, funcs.exists('w:lua'))
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user