fix(remote): restore previous --remote-expr output formatting

- Use tostring() as that's what print() uses internally.
- Do not append trailing new line.

(cherry picked from commit b6d89de60e)
This commit is contained in:
zeertzjq
2023-06-11 21:41:41 +08:00
committed by github-actions[bot]
parent 2f9ee5eb16
commit abed0acf56
3 changed files with 7 additions and 8 deletions

View File

@@ -847,14 +847,13 @@ function vim._cs_remote(rcid, server_addr, connect_error, args)
if rcid == 0 then
return { errmsg = connection_failure_errmsg('Send failed.') }
end
vim.fn.rpcrequest(rcid, 'nvim_input', args[2])
vim.rpcrequest(rcid, 'nvim_input', args[2])
return { should_exit = true, tabbed = false }
elseif subcmd == 'expr' then
if rcid == 0 then
return { errmsg = connection_failure_errmsg('Send expression failed.') }
end
local expr = 'string(' .. args[2] .. ')'
local res = vim.fn.rpcrequest(rcid, 'nvim_eval', expr)
local res = tostring(vim.rpcrequest(rcid, 'nvim_eval', args[2]))
return { result = res, should_exit = true, tabbed = false }
elseif subcmd ~= '' then
return { errmsg = 'Unknown option argument: ' .. args[1] }