mirror of
https://github.com/neovim/neovim.git
synced 2025-09-21 18:58:18 +00:00
fix: allow multiline message for echoerr (#25380)
PROBLEM: Currently `:echoerr` prints multi-line strings in a single line as `:echom` does (Note: `:echon` can print multi-line strings well). This makes stacktrace printed via echoerr difficult to read. Example code: try lua error("lua stacktrace") catch echoerr v:exception endtry Output: Error detected while processing a.vim[5]..a.vim: line 4: Vim(lua):E5108: Error executing lua [string ":lua"]:1: lua stacktrace^@stack traceback:^@^I[C]: in function 'error'^@^I[string ":lua"]:1: in main chunk SOLUTION: Allow echoerr to print multiline messages (e.g., lua exceptions), because this command is usually used to print stacktraces. Output after the fix: Error detected while processing a.vim[5]..a.vim: line 4: Vim(lua):E5108: Error executing lua [string ":lua"]:1: lua stacktrace stack traceback: [C]: in function 'error' [string ":lua"]:1: in main chunk
This commit is contained in:
@@ -8106,7 +8106,7 @@ void ex_execute(exarg_T *eap)
|
||||
// We don't want to abort following commands, restore did_emsg.
|
||||
int save_did_emsg = did_emsg;
|
||||
msg_ext_set_kind("echoerr");
|
||||
emsg(ga.ga_data);
|
||||
emsg_multiline(ga.ga_data, true);
|
||||
if (!force_abort) {
|
||||
did_emsg = save_did_emsg;
|
||||
}
|
||||
|
Reference in New Issue
Block a user