mirror of
https://github.com/neovim/neovim.git
synced 2026-03-28 19:32:01 +00:00
docs: use "ev" convention in event-handlers
Problem: In autocmd examples, using "args" as the event-object name is vague and may be confused with a user-command. Solution: Use "ev" as the conventional event-object name.
This commit is contained in:
@@ -1776,14 +1776,10 @@ describe('nvim_buf_attach on_detach', function()
|
||||
it('called before buf_freeall autocommands', function()
|
||||
exec_lua(function()
|
||||
vim.api.nvim_create_autocmd({ 'BufUnload', 'BufDelete', 'BufWipeout' }, {
|
||||
callback = function(args)
|
||||
callback = function(ev)
|
||||
table.insert(
|
||||
_G.events,
|
||||
('%s: %d %s'):format(
|
||||
args.event,
|
||||
args.buf,
|
||||
tostring(vim.api.nvim_buf_is_loaded(args.buf))
|
||||
)
|
||||
('%s: %d %s'):format(ev.event, ev.buf, tostring(vim.api.nvim_buf_is_loaded(ev.buf)))
|
||||
)
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user