nvim-hs plugin gets unresponsive without showing any error message when it evaluates an expression like vim_command undefined. To reproduce, just run debug' (vim_command undefined) in ghci repl.
Cause
When it evaluates vim_command undefined, the undefined is wrapped in FunctionCall message at Neovim.RPC.FunctionCall.acall, and written in eventQueue. The event handler reads the message and evaluates it, and thus dies.
Possible solution
It can be solved by evaluating the function parameters before inserting into eventQueue:
Description
nvim-hs
plugin gets unresponsive without showing any error message when it evaluates an expression likevim_command undefined
. To reproduce, just rundebug' (vim_command undefined)
in ghci repl.Cause
When it evaluates
vim_command undefined
, theundefined
is wrapped inFunctionCall
message atNeovim.RPC.FunctionCall.acall
, and written ineventQueue
. The event handler reads the message and evaluates it, and thus dies.Possible solution
It can be solved by evaluating the function parameters before inserting into
eventQueue
:Altenatively, it may be better to write a wrapper of
writeTQueue
though it requiresNFData
as subclass ofMessage
.I'll make a PR if you don't mind.