fix(api): nvim_echo free text memory with invalid highlight (#31243)

Fix regression from #31195
This commit is contained in:
luukvbaal 2024-11-17 15:06:44 +01:00 committed by GitHub
parent 10beeee06f
commit 6ea45031d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -823,9 +823,6 @@ HlMessage parse_hl_msg(Array chunks, Error *err)
int hl_id = 0;
if (chunk.size == 2) {
hl_id = object_to_hl_id(chunk.items[1], "text highlight", err);
if (ERROR_SET(err)) {
goto free_exit;
}
}
kv_push(hl_msg, ((HlMessageChunk){ .text = str, .hl_id = hl_id }));
}