Using (nvim:command "echo '...'") crashes if the message contains an apostrophe because it terminates the spliced-in message prematurely, leaving nonsense "Vimscript code" in the ex-command.
For example, the message That's nice will be turned into the ex-command echo 'That's nice', which is not valid Vimscript.
Using
(nvim:command "echo '...'")
crashes if the message contains an apostrophe because it terminates the spliced-in message prematurely, leaving nonsense "Vimscript code" in the ex-command.For example, the message
That's nice
will be turned into the ex-commandecho 'That's nice'
, which is not valid Vimscript.