mirror of
https://github.com/neovim/neovim.git
synced 2025-09-26 13:08:33 +00:00
Merge pull request #27813 from luukvbaal/msgid
feat(ext_messages): add hl_id to ext_messages chunks
This commit is contained in:
@@ -824,16 +824,15 @@ HlMessage parse_hl_msg(Array chunks, Error *err)
|
||||
|
||||
String str = copy_string(chunk.items[0].data.string, NULL);
|
||||
|
||||
int attr = 0;
|
||||
int hl_id = 0;
|
||||
if (chunk.size == 2) {
|
||||
String hl = chunk.items[1].data.string;
|
||||
if (hl.size > 0) {
|
||||
// TODO(bfredl): use object_to_hl_id and allow integer
|
||||
int hl_id = syn_check_group(hl.data, hl.size);
|
||||
attr = hl_id > 0 ? syn_id2attr(hl_id) : 0;
|
||||
hl_id = syn_check_group(hl.data, hl.size);
|
||||
}
|
||||
}
|
||||
kv_push(hl_msg, ((HlMessageChunk){ .text = str, .attr = attr }));
|
||||
kv_push(hl_msg, ((HlMessageChunk){ .text = str, .hl_id = hl_id }));
|
||||
}
|
||||
|
||||
return hl_msg;
|
||||
|
@@ -796,7 +796,7 @@ void nvim_echo(Array chunks, Boolean history, Dict(echo_opts) *opts, Error *err)
|
||||
verbose_enter();
|
||||
}
|
||||
|
||||
msg_multiattr(hl_msg, history ? "echomsg" : "echo", history);
|
||||
msg_multihl(hl_msg, history ? "echomsg" : "echo", history);
|
||||
|
||||
if (opts->verbose) {
|
||||
verbose_leave();
|
||||
|
Reference in New Issue
Block a user