Closed jneem closed 2 years ago
It's likely that we'll not use this approach for scripting, but a WASM plugins sytem instead. If RPC is absolutely required for a specific use case, it may be provided by a RPC plugin. I'll actually add this on my list of things to try with the plugins system.
Sure, that makes sense. Just to be clear about the use case, the workflow is:
The mechanism that gvim
uses to do step 3 is that I configure the tex compiler to include file/line information in the pdf, and then I configure my pdf viewer to run gvim --servername GVIM --remote +%{line} %{input}
when clicked. Rather than opening a new editor, this command communicates (via a socket) with an existing instance of the editor and tells it to jump to some specified line. neovim does something similar, but with a rather richer msgpack API.
I don't think having WASM plugins solves this on its own, although I guess it should be possible to write a WASM plugin that listens on a socket, as long as the plugins aren't sandboxed too tightly. (A quick google suggests that sockets aren't yet supported in WASI, but maybe that will come...)
Thank you for the details. I actually really like this feature and hope to achieve it with Helix in a way or another. As you mentioned, it may be limited at first, but I'm not worried support for networking will greatly improve over time. In the meantime we could even expose host functions for that. In fact, if WASI and networking is not a thing by the time I need it, I'll definitely try this.
Subsumed by #998
After crawling all the related issues and discussions, I found out it seems the RPC solution is not planned to be supported. However I really like and need this latex inverse-search use-case, is there any alternative solution to achieve that in 2024? @jneem
vim (and neovim) allow you to send commands to the editor through a socket (see, e.g. the nvim docs). This is very useful for scripting. For example, the main thing I want it for right now is for synctex support