diff options
author | Gregory Anders <greg@gpanders.com> | 2022-03-19 19:16:19 -0600 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-04-08 15:12:54 +0200 |
commit | 30bc02c6364f384e437a6f53b057522d585492fc (patch) | |
tree | 39cbdcf894f902a18664129ed444d01479909764 /runtime | |
parent | dc9e436986bec15b027c2a8d78782f514c046a8b (diff) | |
download | rneovim-30bc02c6364f384e437a6f53b057522d585492fc.tar.gz rneovim-30bc02c6364f384e437a6f53b057522d585492fc.tar.bz2 rneovim-30bc02c6364f384e437a6f53b057522d585492fc.zip |
feat(api)!: pass args table to autocommand callbacks
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/api.txt | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index b383c5eaef..095f74b65d 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -3240,7 +3240,7 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()* < Parameters: ~ - {event} (String|Array) The event or events to register + {event} (string|array) The event or events to register this autocommand {opts} Dictionary of autocommand options: • group (string|integer) optional: the @@ -3252,9 +3252,26 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()* Cannot be used with {pattern}. • desc (string) optional: description of the autocommand. - • callback (function|string) optional: Lua - function or Vim function (as string) to execute - on event. Cannot be used with {command} + • callback (function|string) optional: if a + string, the name of a Vimscript function to + call when this autocommand is triggered. + Otherwise, a Lua function which is called when + this autocommand is triggered. Cannot be used + with {command}. Lua callbacks can return true + to delete the autocommand; in addition, they + accept a single table argument with the + following keys: + • id: (number) the autocommand id + • event: (string) the name of the event that + triggered the autocommand |autocmd-events| + • group: (number|nil) the autocommand group id, + if it exists + • match: (string) the expanded value of + |<amatch>| + • buf: (number) the expanded value of |<abuf>| + • file: (string) the expanded value of + |<afile>| + • command (string) optional: Vim command to execute on event. Cannot be used with {callback} |