docs(api): nvim_exec_autocmds() default "pattern"

Problem: nvim_exec_autocmds() documentation incorrectly describes the default
for "pattern" as *, when it's actually the current file name (like :doautocmd).

Solution: correct it. Add a test.
This commit is contained in:
Sean Dewar
2026-04-07 09:34:00 +01:00
parent cc0a4a653c
commit b28e5e4898
4 changed files with 12 additions and 4 deletions

View File

@@ -1224,7 +1224,7 @@ function vim.api.nvim_exec2(src, opts) end
--- @param event vim.api.keyset.events|vim.api.keyset.events[] Event(s) to execute.
--- @param opts vim.api.keyset.exec_autocmds Optional filters:
--- - group (`string|integer?`) Group name or id to match against. `autocmd-groups`.
--- - pattern (`string|array?`, default: "*") `autocmd-pattern`. Not allowed with {buffer}.
--- - pattern (`string|array?`, default: current file name) `autocmd-pattern`. Not allowed with {buffer}.
--- - buffer (`integer?`) Buffer id `autocmd-buflocal`. Not allowed with {pattern}.
--- - modeline (`boolean?`, default: true) Process the modeline after the autocommands
--- [<nomodeline>].