mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
fix(vim.opt): Get window options before setting.
This closes #14677, but I also am a little unsure if there are times where this may not be correct. However, this just changes the behavior that even if `was_set` was false, we still get for `nvim_win_get_option`.
This commit is contained in:
@@ -1228,6 +1228,21 @@ describe('lua stdlib', function()
|
||||
eq("only-local", result[8])
|
||||
end)
|
||||
|
||||
it('should allow you to retrieve window opts even if they have not been set', function()
|
||||
local result = exec_lua [[
|
||||
local result = {}
|
||||
table.insert(result, vim.opt.number:get())
|
||||
table.insert(result, vim.opt_local.number:get())
|
||||
|
||||
vim.opt_local.number = true
|
||||
table.insert(result, vim.opt.number:get())
|
||||
table.insert(result, vim.opt_local.number:get())
|
||||
|
||||
return result
|
||||
]]
|
||||
eq({false, false, true, true}, result)
|
||||
end)
|
||||
|
||||
it('should allow all sorts of string manipulation', function()
|
||||
eq({'hello', 'hello world', 'start hello world'}, exec_lua [[
|
||||
local results = {}
|
||||
|
||||
Reference in New Issue
Block a user