aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-06-20 15:04:40 +0200
committerGitHub <noreply@github.com>2022-06-20 15:04:40 +0200
commite3bfc1293e30512a6aa23964a3486ee709ac3f21 (patch)
treec8d1b70ef948a4beafe82195431f1c6607fbe8b7 /src/nvim/normal.c
parentb2ed439bd5ab1b431bb61f8754554c48453495c5 (diff)
parent5d6987210578f5f1c3151988b99a9411f9603374 (diff)
downloadrneovim-e3bfc1293e30512a6aa23964a3486ee709ac3f21.tar.gz
rneovim-e3bfc1293e30512a6aa23964a3486ee709ac3f21.tar.bz2
rneovim-e3bfc1293e30512a6aa23964a3486ee709ac3f21.zip
Merge pull request #18988 from bfredl/uipack
refactor(ui): encode "redraw" events without intermediate allocations
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 35a7ee3319..8e4f78818b 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -2755,13 +2755,13 @@ static void display_showcmd(void)
showcmd_is_clear = (len == 0);
if (ui_has(kUIMessages)) {
- Array content = ARRAY_DICT_INIT;
+ MAXSIZE_TEMP_ARRAY(content, 1);
+ MAXSIZE_TEMP_ARRAY(chunk, 2);
if (len > 0) {
- Array chunk = ARRAY_DICT_INIT;
// placeholder for future highlight support
- ADD(chunk, INTEGER_OBJ(0));
- ADD(chunk, STRING_OBJ(cstr_to_string((char *)showcmd_buf)));
- ADD(content, ARRAY_OBJ(chunk));
+ ADD_C(chunk, INTEGER_OBJ(0));
+ ADD_C(chunk, STRING_OBJ(cstr_as_string((char *)showcmd_buf)));
+ ADD_C(content, ARRAY_OBJ(chunk));
}
ui_call_msg_showcmd(content);
return;