aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/highlight_group.c3
-rw-r--r--src/nvim/message.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c
index 2ae15254ea..afdbd4a32f 100644
--- a/src/nvim/highlight_group.c
+++ b/src/nvim/highlight_group.c
@@ -1887,8 +1887,7 @@ bool syn_list_header(const bool did_header, const int outlen, const int id, bool
if (got_int) {
return true;
}
- msg_outtrans(hl_table[id - 1].sg_name, 0, false);
- name_col = msg_col;
+ msg_col = name_col = msg_outtrans(hl_table[id - 1].sg_name, 0, false);
endcol = 15;
} else if ((ui_has(kUIMessages) || msg_silent) && !force_newline) {
msg_putchar(' ');
diff --git a/src/nvim/message.c b/src/nvim/message.c
index edb332a786..066aa6bc96 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -2129,8 +2129,8 @@ void msg_puts_len(const char *const str, const ptrdiff_t len, int hl_id, bool hi
// If redirection is on, also write to the redirection file.
redir_write(str, len);
- // Don't print anything when using ":silent cmd".
- if (msg_silent != 0) {
+ // Don't print anything when using ":silent cmd" or empty message.
+ if (msg_silent != 0 || *str == NUL) {
return;
}
@@ -2238,6 +2238,11 @@ static void msg_puts_display(const char *str, int maxlen, int hl_id, int recurse
size_t len = maxlen < 0 ? strlen(str) : strnlen(str, (size_t)maxlen);
ga_concat_len(&msg_ext_last_chunk, str, len);
msg_ext_cur_len += len;
+ // When message ends in newline, reset variables used to format message: msg_advance().
+ if (str[len - 1] == '\n') {
+ msg_ext_cur_len = 0;
+ msg_col = 0;
+ }
return;
}