fix(lua): not using global value in vim.opt_global

This commit is contained in:
Phelipe Teles
2023-09-16 19:35:12 -03:00
committed by zeertzjq
parent 68ae7ea529
commit 3a5b46e6bb
2 changed files with 19 additions and 3 deletions

View File

@@ -2222,8 +2222,8 @@ describe('lua stdlib', function()
end)
end) -- vim.opt
describe('opt_local', function()
it('should be able to append to an array list type option', function()
describe('vim.opt_local', function()
it('appends into global value when changing local option value', function()
eq({ "foo,bar,baz,qux" }, exec_lua [[
local result = {}
@@ -2238,6 +2238,19 @@ describe('lua stdlib', function()
end)
end)
describe('vim.opt_global', function()
it('gets current global option value', function()
eq({ "yes" }, exec_lua [[
local result = {}
vim.cmd "setglobal signcolumn=yes"
table.insert(result, vim.opt_global.signcolumn:get())
return result
]])
end)
end)
it('vim.cmd', function()
exec_lua [[
vim.cmd "autocmd BufNew * ++once lua BUF = vim.fn.expand('<abuf>')"