aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ui_bridge.c
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2017-03-20 22:56:58 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-04-01 23:14:05 +0200
commitdd4a5fcbb65ade08b5d2c7951b2924d2d04dc99e (patch)
tree398b4811259964de8f16b5adf034698b46a2e5c4 /src/nvim/ui_bridge.c
parent16babc66870b5579f3305fa1289f25e1dc496655 (diff)
downloadrneovim-dd4a5fcbb65ade08b5d2c7951b2924d2d04dc99e.tar.gz
rneovim-dd4a5fcbb65ade08b5d2c7951b2924d2d04dc99e.tar.bz2
rneovim-dd4a5fcbb65ade08b5d2c7951b2924d2d04dc99e.zip
tui: 'guicursor' shape #6044
Closes #2583
Diffstat (limited to 'src/nvim/ui_bridge.c')
-rw-r--r--src/nvim/ui_bridge.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c
index 25861abc1b..c9bad6b254 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_styleset;
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,23 @@ static void ui_bridge_cursor_goto_event(void **argv)
ui->cursor_goto(ui, PTR2INT(argv[1]), PTR2INT(argv[2]));
}
+static void ui_bridge_cursor_styleset(UI *b, Dictionary style)
+{
+ Object copy = copy_object(DICTIONARY_OBJ(style));
+ Object *pobj = xmalloc(sizeof(copy));
+ *pobj = copy;
+ UI_CALL(b, cursor_styleset, 2, b, pobj);
+}
+static void ui_bridge_cursor_styleset_event(void **argv)
+{
+ UI *ui = UI(argv[0]);
+ Object *styles = (Object *)argv[1];
+
+ ui->cursor_style_set(ui, styles->data.dictionary);
+ api_free_object(*styles);
+ xfree(styles);
+}
+
static void ui_bridge_update_menu(UI *b)
{
UI_CALL(b, update_menu, 1, b);