-
Hi, I'm learning about Neovim's rpc features and I found your plugin a good resource to learn them. Could you explain the following code in your implementation? In particular:
Thank you in advance! flatten.nvim/lua/flatten/guest.lua Lines 17 to 24 in 17bbf3e |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Totally! Block is a boolean that tells the guest instance whether to wait for the host to close the file before exiting. It is sent from host to guest as the return value of The
If you want to learn more about RPC I'd highly recommend reading the official API docs, I found those to be the most helpful resource when implementing this in addition to others' RPC-based plugins. Thanks for using my plugin, let me know if there's anything else you're curious about :) |
Beta Was this translation helpful? Give feedback.
Totally! Block is a boolean that tells the guest instance whether to wait for the host to close the file before exiting. It is sent from host to guest as the return value of
Core.edit_files()
. Ifblock
is false, the guest exits immediately leaving the files open in the host Neovim instance. If it's true, the guest sleeps indefinitely until the host tells it to quit (call torpcnotify()
on core.lua:5), so that external programs such as Git can wait for a file to be written and closed, as is necessary for commits.The
chanclose()
function is used to close the connection from the guest to the host. It's not strictly necessary in this case as the guest instance will exit and terminate the ser…