The autocmd is removed based on the value returned by the api. It surprised me that this worked. Any reason for doing that? Why not use the table passed to the callback to do that? From h:nvim_create_autocmd, a table provides indeed this information:
...
• callback (function|string) optional: if a string, the name
...
autocommand; in addition, they accept a single table
argument with the following keys:
• id: (number) the autocommand id
...
The
autocmd
is removed based on the value returned by the api. It surprised me that this worked. Any reason for doing that? Why not use the table passed to the callback to do that? Fromh:nvim_create_autocmd
, a table provides indeed this information: