diff options
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 61c88b5875..bb89e49e5f 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -420,9 +420,10 @@ void update_screen(int type) } } end_search_hl(); - /* May need to redraw the popup menu. */ - if (pum_visible()) + // May need to redraw the popup menu. + if (pum_drawn()) { pum_redraw(); + } /* Reset b_mod_set flags. Going through all windows is probably faster * than going through all buffers (there could be many buffers). */ @@ -4827,15 +4828,12 @@ void win_redr_status(win_T *wp) wp->w_redr_status = FALSE; if (wp->w_status_height == 0) { - /* no status line, can only be last window */ - redraw_cmdline = TRUE; - } else if (!redrawing() - /* don't update status line when popup menu is visible and may be - * drawn over it */ - || pum_visible() - ) { - /* Don't redraw right now, do it later. */ - wp->w_redr_status = TRUE; + // no status line, can only be last window + redraw_cmdline = true; + } else if (!redrawing() || pum_drawn()) { + // Don't redraw right now, do it later. Don't update status line when + // popup menu is visible and may be drawn over it + wp->w_redr_status = true; } else if (*p_stl != NUL || *wp->w_p_stl != NUL) { /* redraw custom status line */ redraw_custom_statusline(wp); @@ -7081,9 +7079,9 @@ void showruler(int always) { if (!always && !redrawing()) return; - if (pum_visible()) { - /* Don't redraw right now, do it later. */ - curwin->w_redr_status = TRUE; + if (pum_drawn()) { + // Don't redraw right now, do it later. + curwin->w_redr_status = true; return; } if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height) { @@ -7119,9 +7117,10 @@ static void win_redr_ruler(win_T *wp, int always) if (wp == lastwin && lastwin->w_status_height == 0) if (edit_submode != NULL) return; - /* Don't draw the ruler when the popup menu is visible, it may overlap. */ - if (pum_visible()) + // Don't draw the ruler when the popup menu is visible, it may overlap. + if (pum_drawn()) { return; + } if (*p_ruf) { int save_called_emsg = called_emsg; @@ -7371,7 +7370,7 @@ void screen_resize(int width, int height) redrawcmdline(); } else { update_topline(); - if (pum_visible()) { + if (pum_drawn()) { redraw_later(NOT_VALID); ins_compl_show_pum(); /* This includes the redraw. */ } else |