Create opposite event for UnceptionEditRequestReceived
I use the https://github.com/samjwill/nvim-unception/wiki/Setup-with-terminal-toggling-plugins! guide to make my toggle term correctly work with the unception, and to make the behavior just perfect I missed one last detail:
openning toggle term back after nvim unception finished
just notice that after every git commit I need to open the term back to push
https://github.com/samjwill/nvim-unception/assets/16926049/d9b33873-99cf-41fa-93db-c8e7ecb68d36
I'd like to call term.show() right after the unception buffer is closed. Is it possible to make the new event or the callback for this?
Hello again!
This is a great idea, and I think I recall playing around with this a while back. I decided to take another look, and unfortunately doing this is not straightforward due to apparent limitations within neovim itself.
Here's my branch and this is the commit that added the new autocmd to it. If you'd like, feel free to use that branch and play around with it.
Unception currently uses neovim's BufUnload or QuitPre events to unblock the nested client session. As such, if an event is emitted directly after the client is unblocked, and you hook into it to re-show the terminal, the terminal buffer will become the buffer that is unloaded, as it's now the buffer with focus, and both of the aforementioned events are triggered before a given buffer fully unloaded.
Neovim (and vim) do not appear to provide a QuitPost, BufUnloadPost, or similar event that would be emitted after a buffer is unloaded. If it did, doing this would be easy.
There is probably some hack that you could implement which would re-show the terminal without causing it to gain focus, or switch focus back to the buffer being unloaded, but doing so would be a necessity and I'd like to come up with something better. Maybe neovim itself could add something like a QuitPost event?
If you have any ideas for an elegant solution, I'm open to suggestions!