aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ui_bridge.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-04-03 16:16:21 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-04-04 14:19:26 +0200
commit3ccd59ee8216f3da812c5cf81eb392e6a95b539a (patch)
tree218958ab0e2d7b7e359778f68a56079da47a3c2d /src/nvim/ui_bridge.c
parent9d560d5c6b02d34690ca47ee6f32e31ee4a6d90e (diff)
downloadrneovim-3ccd59ee8216f3da812c5cf81eb392e6a95b539a.tar.gz
rneovim-3ccd59ee8216f3da812c5cf81eb392e6a95b539a.tar.bz2
rneovim-3ccd59ee8216f3da812c5cf81eb392e6a95b539a.zip
'guicursor': enabled=false if 'guicursor' is empty
Closes #6429 Closes #6430
Diffstat (limited to 'src/nvim/ui_bridge.c')
-rw-r--r--src/nvim/ui_bridge.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c
index c9bad6b254..9f780663ac 100644
--- a/src/nvim/ui_bridge.c
+++ b/src/nvim/ui_bridge.c
@@ -60,7 +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.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;
@@ -180,19 +180,21 @@ 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)
+static void ui_bridge_cursor_style_set(UI *b, bool enabled, Dictionary styles)
{
- Object copy = copy_object(DICTIONARY_OBJ(style));
- Object *pobj = xmalloc(sizeof(copy));
- *pobj = copy;
- UI_CALL(b, cursor_styleset, 2, b, pobj);
+ 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_styleset_event(void **argv)
+static void ui_bridge_cursor_style_set_event(void **argv)
{
UI *ui = UI(argv[0]);
- Object *styles = (Object *)argv[1];
-
- ui->cursor_style_set(ui, styles->data.dictionary);
+ 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);
}