diff options
| author | Luuk van Baal <luukvbaal@gmail.com> | 2024-03-08 14:44:58 +0100 |
|---|---|---|
| committer | Luuk van Baal <luukvbaal@gmail.com> | 2024-11-09 14:28:17 +0100 |
| commit | 4f9260d06a48216862ebb34fc33744486b058f58 (patch) | |
| tree | f69ecc9f6556e504af0f0b4aa04a72380f866162 /src/nvim/normal.c | |
| parent | 5cfa7a72f8c40cdcc0fa93693689915e913806f1 (diff) | |
| download | rneovim-4f9260d06a48216862ebb34fc33744486b058f58.tar.gz rneovim-4f9260d06a48216862ebb34fc33744486b058f58.tar.bz2 rneovim-4f9260d06a48216862ebb34fc33744486b058f58.zip | |
feat(ext_messages): add hl_id to ext_messages chunks
Problem: Ext_messages chunks only contain the highlight attr id, which
is not very useful for vim.ui_attach() consumers.
Solotion: Add highlight group id to message chunks, which can easily be
used to highlight text in the TUI through nvim_buf_set_extmark():
hl_group = synIDattr(id, "name").
Diffstat (limited to 'src/nvim/normal.c')
| -rw-r--r-- | src/nvim/normal.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |