From fa4c2601000df2d792b0de865da3ac8c43ab723f Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 26 Jul 2018 21:27:41 +0200 Subject: cursor_shape: use attribute ids instead of syntax ids As attribute ids is the convention in the UI protocol Also remove non-threadsafe calls in tui.c to syntax module. --- src/nvim/ui.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/nvim/ui.c') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index ef68b804ba..07aa032a50 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -55,6 +55,7 @@ static int row = 0, col = 0; static bool pending_cursor_update = false; static int busy = 0; static int mode_idx = SHAPE_IDX_N; +static bool pending_mode_info_update = false; static bool pending_mode_update = false; #if MIN_LOG_LEVEL > DEBUG_LOG_LEVEL @@ -368,10 +369,7 @@ void ui_add_linewrap(int row) void ui_mode_info_set(void) { - Array style = mode_style_array(); - bool enabled = (*p_guicursor != NUL); - ui_call_mode_info_set(enabled, style); - api_free_array(style); + pending_mode_info_update = true; } int ui_current_row(void) @@ -391,6 +389,13 @@ void ui_flush(void) ui_call_grid_cursor_goto(1, row, col); pending_cursor_update = false; } + if (pending_mode_info_update) { + Array style = mode_style_array(); + bool enabled = (*p_guicursor != NUL); + ui_call_mode_info_set(enabled, style); + api_free_array(style); + pending_mode_info_update = false; + } if (pending_mode_update) { char *full_name = shape_table[mode_idx].full_name; ui_call_mode_change(cstr_as_string(full_name), mode_idx); -- cgit