diff options
author | Charlie Groves <charlie.groves@gmail.com> | 2022-03-03 16:33:27 -0500 |
---|---|---|
committer | Charlie Groves <charlie.groves@gmail.com> | 2022-03-11 11:16:46 -0500 |
commit | 29c36322857b37263b07eb1301d71ccd8a2ae044 (patch) | |
tree | 48d7b3e3de63be8b0d62b51650ed411f0b34ce7b /runtime/lua/vim/_editor.lua | |
parent | e095a868cbc9ff504087b3df89e4d92d0421ab38 (diff) | |
download | rneovim-29c36322857b37263b07eb1301d71ccd8a2ae044.tar.gz rneovim-29c36322857b37263b07eb1301d71ccd8a2ae044.tar.bz2 rneovim-29c36322857b37263b07eb1301d71ccd8a2ae044.zip |
fix(remote): report on missing wait commands, typecheck lua results
Clean up lint errors, too
Diffstat (limited to 'runtime/lua/vim/_editor.lua')
-rw-r--r-- | runtime/lua/vim/_editor.lua | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index 869a2706ac..030c3b40e8 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -638,56 +638,39 @@ end function vim._cs_remote(rcid, args) local f_silent = false - local f_wait = false local f_tab = false local subcmd = string.sub(args[1],10) - if subcmd == '' then - -- no flags to set - elseif subcmd == 'tab' then + if subcmd == 'tab' then f_tab = true elseif subcmd == 'silent' then f_silent = true - elseif subcmd == 'wait' then - f_wait = true - elseif subcmd == 'wait-silent' then - f_wait = true - f_silent = true - elseif subcmd == 'tab-wait' then - f_tab = true - f_wait = true + elseif subcmd == 'wait' or subcmd == 'wait-silent' or subcmd == 'tab-wait' or subcmd == 'tab-wait-silent' then + return { errmsg = 'E5600: Wait commands not yet implemented in nvim' } elseif subcmd == 'tab-silent' then f_tab = true f_silent = true - elseif subcmd == 'tab-wait-silent' then - f_tab = true - f_wait = true - f_silent = true elseif subcmd == 'send' then if rcid == 0 then - vim.cmd('echoerr "E247: Remote server does not exist. Send failed."') - return + return { errmsg = 'E247: Remote server does not exist. Send failed.' } end vim.fn.rpcrequest(rcid, 'nvim_input', args[2]) return { should_exit = true, tabbed = false } elseif subcmd == 'expr' then if rcid == 0 then - vim.cmd('echoerr "E247: Remote server does not exist. Send expression failed."') - return + return { errmsg = 'E247: Remote server does not exist. Send expression failed.' } end - vim.fn.rpcrequest(rcid, 'nvim_eval', args[2]) + print(vim.fn.rpcrequest(rcid, 'nvim_eval', args[2])) return { should_exit = true, tabbed = false } - else - vim.cmd('echoerr "Unknown option argument: ' .. args[1] .. '"') - return + elseif subcmd ~= '' then + return { errmsg='Unknown option argument: ' .. args[1] } end if rcid == 0 then if not f_silent then vim.cmd('echohl WarningMsg | echomsg "E247: Remote server does not exist. Editing locally" | echohl None') end - should_exit = false else local command = {} if f_tab then table.insert(command, 'tab') end |