api/ui: allow popupmenu to be drawn by external ui

This commit is contained in:
Björn Linse
2016-03-08 10:47:12 +01:00
parent 97c6d80ca7
commit 999af47be8
7 changed files with 153 additions and 48 deletions

View File

@@ -35,6 +35,7 @@
#else
# include "nvim/msgpack_rpc/server.h"
#endif
#include "nvim/api/private/helpers.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ui.c.generated.h"
@@ -143,6 +144,15 @@ void ui_set_icon(char *icon)
UI_CALL(flush);
}
void ui_event(char *name, Array args)
{
bool args_consumed = false;
UI_CALL(event, name, args, &args_consumed);
if (!args_consumed) {
api_free_array(args);
}
}
// May update the shape of the cursor.
void ui_cursor_shape(void)
{
@@ -519,3 +529,4 @@ static void ui_mode_change(void)
UI_CALL(mode_change, mode);
conceal_check_cursur_line();
}