api: use generated events for popupmenu and tabline

This commit is contained in:
Björn Linse
2017-04-29 14:27:22 +02:00
parent 489d10c57c
commit 4eb781ce1d
3 changed files with 5 additions and 15 deletions

View File

@@ -98,7 +98,6 @@ redo:
}
if (pum_external) {
Array args = ARRAY_DICT_INIT;
if (array_changed) {
Array arr = ARRAY_DICT_INIT;
for (i = 0; i < size; i++) {
@@ -109,14 +108,9 @@ redo:
ADD(item, STRING_OBJ(cstr_to_string((char *)array[i].pum_info)));
ADD(arr, ARRAY_OBJ(item));
}
ADD(args, ARRAY_OBJ(arr));
ADD(args, INTEGER_OBJ(selected));
ADD(args, INTEGER_OBJ(row));
ADD(args, INTEGER_OBJ(col));
ui_event("popupmenu_show", args);
ui_call_popupmenu_show(arr, selected, row, col);
} else {
ADD(args, INTEGER_OBJ(selected));
ui_event("popupmenu_select", args);
ui_call_popupmenu_select(selected);
}
return;
}
@@ -713,8 +707,7 @@ void pum_undisplay(void)
pum_array = NULL;
if (pum_external) {
Array args = ARRAY_DICT_INIT;
ui_event("popupmenu_hide", args);
ui_call_popupmenu_hide();
} else {
redraw_all_later(SOME_VALID);
redraw_tabline = true;