diff options
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index e3e69f4ff6..f0848b7e04 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -775,13 +775,15 @@ void nvim_set_vvar(String name, Object value, Error *err) /// `hl_group` element can be omitted for no highlight. /// @param history if true, add to |message-history|. /// @param opts Optional parameters. +/// - err: Treat the message like |:echoerr|. Omitted `hlgroup` +/// uses |hl-ErrorMsg| instead. /// - verbose: Message is printed as a result of 'verbose' option. /// If Nvim was invoked with -V3log_file, the message will be /// redirected to the log_file and suppressed from direct output. void nvim_echo(Array chunks, Boolean history, Dict(echo_opts) *opts, Error *err) FUNC_API_SINCE(7) { - HlMessage hl_msg = parse_hl_msg(chunks, err); + HlMessage hl_msg = parse_hl_msg(chunks, opts->err, err); if (ERROR_SET(err)) { goto error; } @@ -790,7 +792,7 @@ void nvim_echo(Array chunks, Boolean history, Dict(echo_opts) *opts, Error *err) verbose_enter(); } - msg_multihl(hl_msg, history ? "echomsg" : "echo", history); + msg_multihl(hl_msg, opts->err ? "echoerr" : history ? "echomsg" : "echo", history, opts->err); if (opts->verbose) { verbose_leave(); |