cshuaimin / ssr.nvim

Treesitter based structural search and replace plugin for Neovim.
MIT License
933 stars 13 forks source link

fix: stop autocmds from duplicating on each SSR open #32

Open A-Lamia opened 1 year ago

A-Lamia commented 1 year ago

SSR creates instances when Ui:Open is executed but the autocmds are not treated like an instance they are sharing the same autocmds, these autocmds however are being duplicated on each run of Ui:Open causing bad side effects like data invalidation.

On instance creation a unique augroup is created and assigned and only one set of autocmds are allowed to exist each instance, when that instance of SSR is closed the assigned autocmds and augroup is removed for that instance only.

cshuaimin commented 1 year ago

autocmd group is also added in #31