mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 09:12:07 +00:00
Merge pull request #17929 from lewis6991/autocmd
fix(api): improve autocmd error handling
This commit is contained in:
@@ -809,6 +809,14 @@ describe('autocmd api', function()
|
||||
eq(2, get_executed_count(), "No additional counts")
|
||||
end)
|
||||
|
||||
it('can delete non-existent groups with pcall', function()
|
||||
eq(false, exec_lua[[return pcall(vim.api.nvim_del_augroup_by_name, 'noexist')]])
|
||||
eq('Vim:E367: No such group: "noexist"', pcall_err(meths.del_augroup_by_name, 'noexist'))
|
||||
|
||||
eq(false, exec_lua[[return pcall(vim.api.nvim_del_augroup_by_id, -12342)]])
|
||||
eq('Vim:E367: No such group: "--Deleted--"', pcall_err(meths.del_augroup_by_id, -12312))
|
||||
end)
|
||||
|
||||
it('groups work with once', function()
|
||||
local augroup = "TestGroup"
|
||||
|
||||
|
Reference in New Issue
Block a user