diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-10-14 23:08:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 23:08:00 +0800 |
commit | e6f7e038b8bbca487e78ebfc6fe21d6852330623 (patch) | |
tree | b481830182b90e1f4651e5cafe17ae2bea8f28b3 /src | |
parent | e5cb3104d07228de4f2614c425355e8f2f99507d (diff) | |
download | rneovim-e6f7e038b8bbca487e78ebfc6fe21d6852330623.tar.gz rneovim-e6f7e038b8bbca487e78ebfc6fe21d6852330623.tar.bz2 rneovim-e6f7e038b8bbca487e78ebfc6fe21d6852330623.zip |
fix(completion): set pum_size even if ext_popupmenu is used (#20648)
This allows CompleteChanged event to get the correct `v:event.size`.
It should be harmless and more consistent to also set `pum_array`.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/popupmenu.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c index 74376c8b8a..3a3f966d10 100644 --- a/src/nvim/popupmenu.c +++ b/src/nvim/popupmenu.c @@ -264,12 +264,15 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed, i pum_row = above_row; pum_height = pum_win_row - above_row; } + + pum_array = array; + // Set "pum_size" before returning so that pum_set_event_info() gets the correct size. + pum_size = size; + if (pum_external) { return; } - pum_array = array; - pum_size = size; pum_compute_size(); int max_width = pum_base_width; |