aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ui_bridge.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-08 01:54:58 +0300
committerZyX <kp-pav@yandex.ru>2017-04-08 01:54:58 +0300
commit043d8ff9f2389f8deab7934aa0ab4ce88a747f01 (patch)
tree4d6fa32d7c1ddaa99c15f80c1a4ba95d5f3ca2da /src/nvim/ui_bridge.c
parent5992cdf3c27ee9c73cea22e288c6ea6d54867394 (diff)
parent13352c00f1909d9296c5f276a3735f5e6f231b39 (diff)
downloadrneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.tar.gz
rneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.tar.bz2
rneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.zip
Merge branch 'master' into luaviml'/lua
Diffstat (limited to 'src/nvim/ui_bridge.c')
-rw-r--r--src/nvim/ui_bridge.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c
index 25861abc1b..9f780663ac 100644
--- a/src/nvim/ui_bridge.c
+++ b/src/nvim/ui_bridge.c
@@ -13,6 +13,7 @@
#include "nvim/memory.h"
#include "nvim/ui_bridge.h"
#include "nvim/ugrid.h"
+#include "nvim/api/private/helpers.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ui_bridge.c.generated.h"
@@ -59,6 +60,7 @@ UI *ui_bridge_attach(UI *ui, ui_main_fn ui_main, event_scheduler scheduler)
rv->bridge.clear = ui_bridge_clear;
rv->bridge.eol_clear = ui_bridge_eol_clear;
rv->bridge.cursor_goto = ui_bridge_cursor_goto;
+ rv->bridge.cursor_style_set = ui_bridge_cursor_style_set;
rv->bridge.update_menu = ui_bridge_update_menu;
rv->bridge.busy_start = ui_bridge_busy_start;
rv->bridge.busy_stop = ui_bridge_busy_stop;
@@ -178,6 +180,25 @@ static void ui_bridge_cursor_goto_event(void **argv)
ui->cursor_goto(ui, PTR2INT(argv[1]), PTR2INT(argv[2]));
}
+static void ui_bridge_cursor_style_set(UI *b, bool enabled, Dictionary styles)
+{
+ bool *enabledp = xmalloc(sizeof(*enabledp));
+ Object *stylesp = xmalloc(sizeof(*stylesp));
+ *enabledp = enabled;
+ *stylesp = copy_object(DICTIONARY_OBJ(styles));
+ UI_CALL(b, cursor_style_set, 3, b, enabledp, stylesp);
+}
+static void ui_bridge_cursor_style_set_event(void **argv)
+{
+ UI *ui = UI(argv[0]);
+ bool *enabled = argv[1];
+ Object *styles = argv[2];
+ ui->cursor_style_set(ui, *enabled, styles->data.dictionary);
+ xfree(enabled);
+ api_free_object(*styles);
+ xfree(styles);
+}
+
static void ui_bridge_update_menu(UI *b)
{
UI_CALL(b, update_menu, 1, b);