diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/ui.txt | 1 | ||||
-rw-r--r-- | runtime/lua/vim/_editor.lua | 13 |
2 files changed, 5 insertions, 9 deletions
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 4ee8121034..4e8253c47a 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -796,6 +796,7 @@ must handle. "echomsg" |:echomsg| message "echoerr" |:echoerr| message "lua_error" Error in |:lua| code + "lua_print" |print()| from |:lua| code "rpc_error" Error response from |rpcrequest()| "return_prompt" |press-enter| prompt after a multiple messages "quickfix" Quickfix navigation message diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index b4a1e0fc15..44f17b3f85 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -1151,21 +1151,16 @@ end --- @param ... any --- @return any # given arguments. function vim.print(...) - if vim.in_fast_event() then - print(...) - return ... - end - + local msg = {} for i = 1, select('#', ...) do local o = select(i, ...) if type(o) == 'string' then - vim.api.nvim_out_write(o) + table.insert(msg, o) else - vim.api.nvim_out_write(vim.inspect(o, { newline = '\n', indent = ' ' })) + table.insert(msg, vim.inspect(o, { newline = '\n', indent = ' ' })) end - vim.api.nvim_out_write('\n') end - + print(table.concat(msg, '\n')) return ... end |