aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/message.c5
-rw-r--r--src/nvim/normal.c3
-rw-r--r--src/nvim/statusline.c4
3 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index dc9c7d0c37..977b37f8c3 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -139,6 +139,7 @@ static const char *msg_ext_kind = NULL;
static Array *msg_ext_chunks = NULL;
static garray_T msg_ext_last_chunk = GA_INIT(sizeof(char), 40);
static sattr_T msg_ext_last_attr = -1;
+static int msg_ext_hl_id;
static size_t msg_ext_cur_len = 0;
static bool msg_ext_overwrite = false; ///< will overwrite last message
@@ -1088,12 +1089,14 @@ void ex_messages(exarg_T *eap)
Array content_entry = ARRAY_DICT_INIT;
ADD(content_entry, INTEGER_OBJ(chunk.hl_id ? syn_id2attr(chunk.hl_id) : 0));
ADD(content_entry, STRING_OBJ(copy_string(chunk.text, NULL)));
+ ADD(content_entry, INTEGER_OBJ(chunk.hl_id));
ADD(content, ARRAY_OBJ(content_entry));
}
} else if (p->msg && p->msg[0]) {
Array content_entry = ARRAY_DICT_INIT;
ADD(content_entry, INTEGER_OBJ(p->hl_id ? syn_id2attr(p->hl_id) : 0));
ADD(content_entry, CSTR_TO_OBJ(p->msg));
+ ADD(content_entry, INTEGER_OBJ(p->hl_id));
ADD(content, ARRAY_OBJ(content_entry));
}
ADD(entry, ARRAY_OBJ(content));
@@ -2125,6 +2128,7 @@ static void msg_ext_emit_chunk(void)
msg_ext_last_attr = -1;
String text = ga_take_string(&msg_ext_last_chunk);
ADD(chunk, STRING_OBJ(text));
+ ADD(chunk, INTEGER_OBJ(msg_ext_hl_id));
ADD(*msg_ext_chunks, ARRAY_OBJ(chunk));
}
@@ -2141,6 +2145,7 @@ static void msg_puts_display(const char *str, int maxlen, int hl_id, int recurse
if (ui_has(kUIMessages)) {
if (attr != msg_ext_last_attr) {
+ msg_ext_hl_id = hl_id;
msg_ext_emit_chunk();
msg_ext_last_attr = attr;
}
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index d0517d5e4f..d2716bf236 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -2081,11 +2081,12 @@ static void display_showcmd(void)
if (ui_has(kUIMessages)) {
MAXSIZE_TEMP_ARRAY(content, 1);
- MAXSIZE_TEMP_ARRAY(chunk, 2);
+ MAXSIZE_TEMP_ARRAY(chunk, 3);
if (!showcmd_is_clear) {
// placeholder for future highlight support
ADD_C(chunk, INTEGER_OBJ(0));
ADD_C(chunk, CSTR_AS_OBJ(showcmd_buf));
+ ADD_C(chunk, INTEGER_OBJ(0));
ADD_C(content, ARRAY_OBJ(chunk));
}
ui_call_msg_showcmd(content);
diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c
index 6b8f5e27a3..d9ac1aa347 100644
--- a/src/nvim/statusline.c
+++ b/src/nvim/statusline.c
@@ -582,9 +582,11 @@ void win_redr_ruler(win_T *wp)
if (ui_has(kUIMessages) && !part_of_status) {
MAXSIZE_TEMP_ARRAY(content, 1);
- MAXSIZE_TEMP_ARRAY(chunk, 2);
+ MAXSIZE_TEMP_ARRAY(chunk, 3);
ADD_C(chunk, INTEGER_OBJ(attr));
ADD_C(chunk, CSTR_AS_OBJ(buffer));
+ ADD_C(chunk, INTEGER_OBJ(HLF_MSG + 1));
+ assert(attr == HL_ATTR(HLF_MSG));
ADD_C(content, ARRAY_OBJ(chunk));
ui_call_msg_ruler(content);
did_show_ext_ruler = true;