janestreet / vcaml

OCaml bindings for the Neovim API
MIT License
148 stars 4 forks source link

NVIM_LISTEN_ADDRESS is deprecated an unset #2

Closed danielo515 closed 1 year ago

danielo515 commented 2 years ago

https://neovim.io/doc/user/deprecated.html

Environment Variables
$NVIM_LISTEN_ADDRESS    Deprecated way to
set the server name (use [--listen](https://neovim.io/doc/user/starting.html#--listen) instead)
get the server name (use [v:servername](https://neovim.io/doc/user/eval.html#v%3Aservername) instead)
detect a parent Nvim (use [$NVIM](https://neovim.io/doc/user/eval.html#%24NVIM) instead) Unset by [terminal](https://neovim.io/doc/user/nvim_terminal_emulator.html#terminal) and [jobstart()](https://neovim.io/doc/user/builtin.html#jobstart()) (unless explicitly given by the "env" option). Ignored if --listen is given.

Which makes the basic examples on this repo (for example, hello world) to fail

danielo515 commented 2 years ago

In case anyone is looking for a workaround, this seems to be working properly (setting the NVIM_LISTEN_ADDRESS when calling the job):

" To run the plugin, first build the executable in bin/, and then source this file.

let current_dir = expand('<sfile>:p:h')
let opts = { 'env': { 'NVIM_LISTEN_ADDRESS': v:servername  } }
" Start the plugin.
call jobstart([current_dir . '/_build/default/bin/main.exe'], opts)
dkalinichenko-js commented 1 year ago

Fixed.