0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.1.1901: the +insert_expand feature is not always available

Problem:    The +insert_expand feature is not always available.
Solution:   Graduate the +insert_expand feature.
This commit is contained in:
Bram Moolenaar
2019-08-21 14:37:09 +02:00
parent d933c82ff4
commit e2c453d38f
34 changed files with 85 additions and 383 deletions

View File

@@ -785,10 +785,8 @@ update_screen(int type_arg)
#if defined(FEAT_SEARCH_EXTRA)
end_search_hl();
#endif
#ifdef FEAT_INS_EXPAND
/* May need to redraw the popup menu. */
pum_may_redraw();
#endif
/* Reset b_mod_set flags. Going through all windows is probably faster
* than going through all buffers (there could be many buffers). */
@@ -6877,12 +6875,9 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
redraw_cmdline = TRUE;
}
else if (!redrawing()
#ifdef FEAT_INS_EXPAND
// don't update status line when popup menu is visible and may be
// drawn over it, unless it will be redrawn later
|| (!ignore_pum && pum_visible())
#endif
)
|| (!ignore_pum && pum_visible()))
{
/* Don't redraw right now, do it later. */
wp->w_redr_status = TRUE;
@@ -7968,16 +7963,14 @@ screen_char(unsigned off, int row, int col)
if (row >= screen_Rows || col >= screen_Columns)
return;
#ifdef FEAT_INS_EXPAND
// Skip if under the popup menu.
// Popup windows with zindex higher than POPUPMENU_ZINDEX go on top.
if (pum_under_menu(row, col)
# ifdef FEAT_TEXT_PROP
#ifdef FEAT_TEXT_PROP
&& screen_zindex <= POPUPMENU_ZINDEX
# endif
#endif
)
return;
#endif
#ifdef FEAT_TEXT_PROP
if (blocked_by_popup(row, col))
return;
@@ -9953,9 +9946,7 @@ showmode(void)
int do_mode;
int attr;
int nwr_save;
#ifdef FEAT_INS_EXPAND
int sub_attr;
#endif
do_mode = ((p_smd && msg_silent == 0)
&& ((State & INSERT)
@@ -10010,7 +10001,6 @@ showmode(void)
}
}
#endif
#ifdef FEAT_INS_EXPAND
/* CTRL-X in Insert mode */
if (edit_submode != NULL && !shortmess(SHM_COMPLETIONMENU))
{
@@ -10041,7 +10031,6 @@ showmode(void)
}
}
else
#endif
{
if (State & VREPLACE_FLAG)
msg_puts_attr(_(" VREPLACE"), attr);
@@ -10106,10 +10095,7 @@ showmode(void)
need_clear = TRUE;
}
if (reg_recording != 0
#ifdef FEAT_INS_EXPAND
&& edit_submode == NULL /* otherwise it gets too long */
#endif
)
&& edit_submode == NULL) // otherwise it gets too long
{
recording_mode(attr);
need_clear = TRUE;
@@ -10566,14 +10552,12 @@ showruler(int always)
{
if (!always && !redrawing())
return;
#ifdef FEAT_INS_EXPAND
if (pum_visible())
{
/* Don't redraw right now, do it later. */
curwin->w_redr_status = TRUE;
return;
}
#endif
#if defined(FEAT_STL_OPT)
if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height)
redraw_custom_statusline(curwin);
@@ -10626,9 +10610,8 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum)
if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count)
return;
#ifdef FEAT_INS_EXPAND
/* Don't draw the ruler while doing insert-completion, it might overwrite
* the (long) mode message. */
// Don't draw the ruler while doing insert-completion, it might overwrite
// the (long) mode message.
if (wp == lastwin && lastwin->w_status_height == 0)
if (edit_submode != NULL)
return;
@@ -10636,7 +10619,6 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum)
// Except when the popup menu will be redrawn anyway.
if (!ignore_pum && pum_visible())
return;
#endif
#ifdef FEAT_STL_OPT
if (*p_ruf)