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`.
This commit is contained in:
zeertzjq
2022-10-14 23:08:00 +08:00
committed by GitHub
parent e5cb3104d0
commit e6f7e038b8
2 changed files with 48 additions and 2 deletions

View File

@@ -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;