hadronized / mind.nvim

The power of trees at your fingertips.
Other
688 stars 42 forks source link

refactor(commands): autocmd id from callback table #81

Closed e-roux closed 1 year ago

e-roux commented 1 year ago

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
    ...