diff options
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); | 
