neovim / node-client

Nvim Node.js client and plugin host
https://neovim.io/node-client/
MIT License
492 stars 53 forks source link

Calling same method/arguments with request() results in different behavior comparing Lua and Node #165

Closed trkoch closed 3 years ago

trkoch commented 3 years ago

See https://github.com/neovim/neovim/issues/13890#issuecomment-774542572. I don't know how to do this from Lua myself.

Steps to reproduce

$ nvim -u NORC --listen /tmp/vim

Buffer

AAA
BBB

neovim/node-client

$ NVIM_LISTEN_ADDRESS=/tmp/vim NVIM_NODE_LOG_FILE=nvim.log node --experimental-repl-await
> const nvim = await require('neovim/scripts/nvim')
> await nvim.request('nvim_buf_set_text', [0, 0, 0, 1, 3, ['XXX', 'YYY']])

Actual behaviour

Buffer

XXX
YYY
BBB

Expected behaviour

XXX
YYY

(Apparently this is the behavior when doing the same thing with Lua inside Neovim).

trkoch commented 3 years ago

Turns out node-client does in fact have the behavior as Lua inside Neovim.