diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-08-14 12:33:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-14 12:33:12 +0200 |
commit | f767cee10002afc360af1aad209676d08cc3a758 (patch) | |
tree | f47652d37d72abf921de07ce1bd4ca35f85ca4ce /src/nvim/ui.c | |
parent | bec5e4cb6183f3b403aca35ef55c3798a48dc64b (diff) | |
parent | fa4c2601000df2d792b0de865da3ac8c43ab723f (diff) | |
download | rneovim-f767cee10002afc360af1aad209676d08cc3a758.tar.gz rneovim-f767cee10002afc360af1aad209676d08cc3a758.tar.bz2 rneovim-f767cee10002afc360af1aad209676d08cc3a758.zip |
Merge pull request #8790 from bfredl/hlattr
pass highlight attrs per value and thread-safely to TUI thread
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); |