aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorDhruv Manilawala <dhruvmanila@gmail.com>2022-03-08 09:45:43 +0530
committerGitHub <noreply@github.com>2022-03-07 23:15:43 -0500
commit2783f4cc4a410cd3b73e8cdfbdf8c859c426c6c6 (patch)
treecace7d0216100ece7da702f64a19d0d454ac815e /runtime
parent3cc48e62739a310b592126cb7465d873b5c2d3b2 (diff)
downloadrneovim-2783f4cc4a410cd3b73e8cdfbdf8c859c426c6c6.tar.gz
rneovim-2783f4cc4a410cd3b73e8cdfbdf8c859c426c6c6.tar.bz2
rneovim-2783f4cc4a410cd3b73e8cdfbdf8c859c426c6c6.zip
feat(api): autocmd `group` can be either name or id (#17559)
* feat(api): `group` can be either string or int This affects the following API functions: - `vim.api.nvim_create_autocmd` - `vim.api.nvim_get_autocmds` - `vim.api.nvim_do_autocmd` closes #17552 * refactor: add two maps for fast lookups * fix: delete augroup info from id->name map When in "stupid_legacy_mode", the value in name->id map would be updated to `AUGROUP_DELETED`, but the entry would still remain in id->name. This would create a problem in `augroup_name` function which would return the name of the augroup instead of `--DELETED--`. The id->name map is only used for fast loopup in `augroup_name` function so there's no point in keeping the entry of deleted augroup in it. Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/api.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 73536d174a..eefe6e5a47 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3165,7 +3165,7 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
• create a |autocmd-buflocal| autocmd.
• NOTE: Cannot be used with {pattern}
- • group: (string) The augroup name
+ • group: (string|int) The augroup name or id
• once: (boolean) - See |autocmd-once|
• nested: (boolean) - See |autocmd-nested|
• desc: (string) - Description of the autocmd
@@ -3213,7 +3213,7 @@ nvim_do_autocmd({event}, {*opts}) *nvim_do_autocmd()*
"*".
• NOTE: Cannot be used with {buffer}
- • group (string) - autocmd group name
+ • group (string|int) - autocmd group name or id
• modeline (boolean) - Default true, see
|<nomodeline>|
@@ -3224,7 +3224,8 @@ nvim_get_autocmds({*opts}) *nvim_get_autocmds()*
{opts} Optional Parameters:
• event : Name or list of name of events to match
against
- • group (string): Name of group to match against
+ • group (string|int): Name or id of group to match
+ against
• pattern: Pattern or list of patterns to match
against. Cannot be used with {buffer}
• buffer: Buffer number or list of buffer numbers