diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-07-26 21:27:41 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2018-08-13 13:35:35 +0200 |
commit | fa4c2601000df2d792b0de865da3ac8c43ab723f (patch) | |
tree | 9048f5e4bf1a7aa06c24eade3f7b8f27fd9cacca /src/nvim/ui.c | |
parent | fab555e59c627b07e8a2d229d95737be7d6ce666 (diff) | |
download | rneovim-fa4c2601000df2d792b0de865da3ac8c43ab723f.tar.gz rneovim-fa4c2601000df2d792b0de865da3ac8c43ab723f.tar.bz2 rneovim-fa4c2601000df2d792b0de865da3ac8c43ab723f.zip |
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.
Diffstat (limited to 'src/nvim/ui.c')
-rw-r--r-- | src/nvim/ui.c | 13 |
1 files changed, 9 insertions, 4 deletions
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); |