mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 08:32:42 +00:00
api: Make nvim_set_option() update :verbose set ...
Make `:verbose set ...` show when an option was last modified by an API client or Lua script/chunk. In the case of an API client, the channel ID is displayed.
This commit is contained in:
@@ -291,6 +291,21 @@ describe('api', function()
|
||||
eq(false, status)
|
||||
ok(err:match('Invalid option name') ~= nil)
|
||||
end)
|
||||
|
||||
it('updates where the option was last set from', function()
|
||||
nvim('set_option', 'equalalways', false)
|
||||
local status, rv = pcall(nvim, 'command_output',
|
||||
'verbose set equalalways?')
|
||||
eq(true, status)
|
||||
ok(nil ~= string.find(rv, 'noequalalways\n'..
|
||||
'\tLast set from API client %(channel id %d+%)'))
|
||||
|
||||
nvim('execute_lua', 'vim.api.nvim_set_option("equalalways", true)', {})
|
||||
local status, rv = pcall(nvim, 'command_output',
|
||||
'verbose set equalalways?')
|
||||
eq(true, status)
|
||||
eq(' equalalways\n\tLast set from Lua', rv)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('nvim_{get,set}_current_buf, nvim_list_bufs', function()
|
||||
|
||||
Reference in New Issue
Block a user