mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
api: use generated events for popupmenu and tabline
This commit is contained in:
parent
489d10c57c
commit
4eb781ce1d
@ -38,5 +38,6 @@ void set_icon(String icon);
|
||||
void popupmenu_show(Array items, Integer selected, Integer row, Integer col) REMOTE_ONLY;
|
||||
void popupmenu_hide(void) REMOTE_ONLY;
|
||||
void popupmenu_select(Integer selected) REMOTE_ONLY;
|
||||
void tabline_update(Tabpage current, Array tabs) REMOTE_ONLY;
|
||||
|
||||
#endif // NVIM_API_UI_EVENTS_IN_H
|
||||
|
@ -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;
|
||||
|
@ -7087,8 +7087,6 @@ static void draw_tabline(void)
|
||||
|
||||
void ui_ext_tabline_update(void)
|
||||
{
|
||||
Array args = ARRAY_DICT_INIT;
|
||||
ADD(args, TABPAGE_OBJ(curtab->handle));
|
||||
Array tabs = ARRAY_DICT_INIT;
|
||||
FOR_ALL_TABS(tp) {
|
||||
Dictionary tab_info = ARRAY_DICT_INIT;
|
||||
@ -7100,9 +7098,7 @@ void ui_ext_tabline_update(void)
|
||||
|
||||
ADD(tabs, DICTIONARY_OBJ(tab_info));
|
||||
}
|
||||
ADD(args, ARRAY_OBJ(tabs));
|
||||
|
||||
ui_event("tabline_update", args);
|
||||
ui_call_tabline_update(curtab->handle, tabs);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user