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.
diff --git a/src/screen.c b/src/screen.c
index cb2d07b..5043c0d 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -785,10 +785,8 @@
#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 @@
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 @@
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 @@
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 @@
}
}
#endif
-#ifdef FEAT_INS_EXPAND
/* CTRL-X in Insert mode */
if (edit_submode != NULL && !shortmess(SHM_COMPLETIONMENU))
{
@@ -10041,7 +10031,6 @@
}
}
else
-#endif
{
if (State & VREPLACE_FLAG)
msg_puts_attr(_(" VREPLACE"), attr);
@@ -10106,10 +10095,7 @@
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 @@
{
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 @@
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 @@
// Except when the popup menu will be redrawn anyway.
if (!ignore_pum && pum_visible())
return;
-#endif
#ifdef FEAT_STL_OPT
if (*p_ruf)