summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-21 14:37:09 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-21 14:37:09 +0200
commite2c453d38f6512ac4cff7cd26aa7780b4e2534d7 (patch)
tree8458a35d59ac43121bfd2d24d5e9f7f54969d0dc
parentd933c82ff4e2c910bd533ed9a50377699c3f5ec9 (diff)
patch 8.1.1901: the +insert_expand feature is not always availablev8.1.1901
Problem: The +insert_expand feature is not always available. Solution: Graduate the +insert_expand feature.
-rw-r--r--runtime/doc/change.txt6
-rw-r--r--runtime/doc/index.txt3
-rw-r--r--runtime/doc/insert.txt6
-rw-r--r--runtime/doc/options.txt14
-rw-r--r--src/autocmd.c9
-rw-r--r--src/buffer.c6
-rw-r--r--src/change.c5
-rw-r--r--src/charset.c6
-rw-r--r--src/edit.c81
-rw-r--r--src/evalfunc.c10
-rw-r--r--src/ex_cmds.c2
-rw-r--r--src/ex_getln.c2
-rw-r--r--src/feature.h13
-rw-r--r--src/getchar.c9
-rw-r--r--src/globals.h20
-rw-r--r--src/gui.c7
-rw-r--r--src/highlight.c6
-rw-r--r--src/indent.c2
-rw-r--r--src/insexpand.c17
-rw-r--r--src/misc2.c4
-rw-r--r--src/move.c18
-rw-r--r--src/option.c68
-rw-r--r--src/option.h12
-rw-r--r--src/popupmnu.c36
-rw-r--r--src/proto.h2
-rw-r--r--src/screen.c30
-rw-r--r--src/search.c46
-rw-r--r--src/spell.c2
-rw-r--r--src/structs.h8
-rw-r--r--src/tag.c4
-rw-r--r--src/term.c2
-rw-r--r--src/userfunc.c2
-rw-r--r--src/version.c6
-rw-r--r--src/vim.h4
34 files changed, 85 insertions, 383 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 4c87726aa8..dc9accadbd 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -691,10 +691,8 @@ The flags that you can use for the substitute commands:
<Esc> to quit substituting
'a' to substitute this and all remaining matches
'q' to quit substituting
- CTRL-E to scroll the screen up {not available when compiled
- without the |+insert_expand| feature}
- CTRL-Y to scroll the screen down {not available when compiled
- without the |+insert_expand| feature}
+ CTRL-E to scroll the screen up
+ CTRL-Y to scroll the screen down
If the 'edcompatible' option is on, Vim remembers the [c] flag and
toggles it each time you use it, but resets it when you give a new
search pattern.
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index f6cf2b5a3a..091ffb2215 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt* For Vim version 8.1. Last change: 2019 Aug 16
+*index.txt* For Vim version 8.1. Last change: 2019 Aug 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -166,7 +166,6 @@ commands in CTRL-X submode *i_CTRL-X_index*
|i_CTRL-X_CTRL-V| CTRL-X CTRL-V complete like in : command line
|i_CTRL-X_CTRL-]| CTRL-X CTRL-] complete tags
|i_CTRL-X_s| CTRL-X s spelling suggestions
-{not available when compiled without the |+insert_expand| feature}
commands in completion mode (see |popupmenu-keys|)
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 8ba360b620..87407e160c 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -300,8 +300,7 @@ character is written at the end of each line. Thus if you want to insert a
*i_CTRL-X* *insert_expand*
CTRL-X enters a sub-mode where several commands can be used. Most of these
-commands do keyword completion; see |ins-completion|. These are not available
-when Vim was compiled without the |+insert_expand| feature.
+commands do keyword completion; see |ins-completion|.
Two commands can be used to scroll the window up or down, without exiting
insert mode:
@@ -609,9 +608,6 @@ In Insert and Replace mode, there are several commands to complete part of a
keyword or line that has been typed. This is useful if you are using
complicated keywords (e.g., function names with capitals and underscores).
-These commands are not available when the |+insert_expand| feature was
-disabled at compile time.
-
Completion can be done for:
1. Whole lines |i_CTRL-X_CTRL-L|
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index caca308f07..e5ad114e20 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 8.1. Last change: 2019 Aug 18
+*options.txt* For Vim version 8.1. Last change: 2019 Aug 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1866,7 +1866,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'completefunc' 'cfu' string (default: empty)
local to buffer
{not available when compiled without the |+eval|
- or |+insert_expand| features}
+ feature}
This option specifies a function to be used for Insert mode completion
with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U|
See |complete-functions| for an explanation of how the function is
@@ -1892,8 +1892,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'completeopt'* *'cot'*
'completeopt' 'cot' string (default: "menu,preview")
global
- {not available when compiled without the
- |+insert_expand| feature}
A comma separated list of options for Insert mode completion
|ins-completion|. The supported values are:
@@ -5233,8 +5231,6 @@ A jump table for the options with a short description can be found at |Q_op|.
In the "popup" model the right mouse button produces a pop-up menu.
You need to define this first, see |popup-menu|.
- In a terminal the popup menu works if Vim is compiled with the
- |+insert_expand| option.
Note that you can further refine the meaning of buttons with mappings.
See |gui-mouse-mapping|. But mappings are NOT used for modeless
@@ -5419,7 +5415,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'omnifunc' 'ofu' string (default: empty)
local to buffer
{not available when compiled without the |+eval|
- or |+insert_expand| features}
+ feature}
This option specifies a function to be used for Insert mode omni
completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O|
See |complete-functions| for an explanation of how the function is
@@ -5749,8 +5745,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'pumheight'* *'ph'*
'pumheight' 'ph' number (default 0)
global
- {not available when compiled without the
- |+insert_expand| feature}
Determines the maximum number of items to show in the popup menu for
Insert mode completion. When zero as much space as available is used.
|ins-completion-menu|.
@@ -5758,8 +5752,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'pumwidth'* *'pw'*
'pumwidth' 'pw' number (default 15)
global
- {not available when compiled without the
- |+insert_expand| feature}
Determines the minimum width to use for the popup menu for Insert mode
completion. |ins-completion-menu|.
diff --git a/src/autocmd.c b/src/autocmd.c
index 640032b608..8a6896bae8 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -1678,10 +1678,7 @@ trigger_cursorhold(void)
&& has_cursorhold()
&& reg_recording == 0
&& typebuf.tb_len == 0
-#ifdef FEAT_INS_EXPAND
- && !ins_compl_active()
-#endif
- )
+ && !ins_compl_active())
{
state = get_real_state();
if (state == NORMAL_BUSY || (state & INSERT) != 0)
@@ -1726,7 +1723,6 @@ has_textchangedI(void)
return (first_autopat[(int)EVENT_TEXTCHANGEDI] != NULL);
}
-#if defined(FEAT_INS_EXPAND) || defined(PROTO)
/*
* Return TRUE when there is a TextChangedP autocommand defined.
*/
@@ -1735,7 +1731,6 @@ has_textchangedP(void)
{
return (first_autopat[(int)EVENT_TEXTCHANGEDP] != NULL);
}
-#endif
/*
* Return TRUE when there is an InsertCharPre autocommand defined.
@@ -2044,9 +2039,7 @@ apply_autocmds_group(
if (!autocmd_busy)
{
save_search_patterns();
-#ifdef FEAT_INS_EXPAND
if (!ins_compl_active())
-#endif
{
saveRedobuff(&save_redo);
did_save_redobuff = TRUE;
diff --git a/src/buffer.c b/src/buffer.c
index f9686a7bd8..a9aa30c3e3 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -310,9 +310,7 @@ open_buffer(
/* Set last_changedtick to avoid triggering a TextChanged autocommand right
* after it was added. */
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
-#ifdef FEAT_INS_EXPAND
curbuf->b_last_changedtick_pum = CHANGEDTICK(curbuf);
-#endif
/* require "!" to overwrite the file, because it wasn't read completely */
#ifdef FEAT_EVAL
@@ -2228,9 +2226,7 @@ free_buf_options(
#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT)
clear_string_option(&buf->b_p_cinw);
#endif
-#ifdef FEAT_INS_EXPAND
clear_string_option(&buf->b_p_cpt);
-#endif
#ifdef FEAT_COMPL_FUNC
clear_string_option(&buf->b_p_cfu);
clear_string_option(&buf->b_p_ofu);
@@ -2247,10 +2243,8 @@ free_buf_options(
#ifdef FEAT_EVAL
clear_string_option(&buf->b_p_tfu);
#endif
-#ifdef FEAT_INS_EXPAND
clear_string_option(&buf->b_p_dict);
clear_string_option(&buf->b_p_tsr);
-#endif
#ifdef FEAT_TEXTOBJ
clear_string_option(&buf->b_p_qe);
#endif
diff --git a/src/change.c b/src/change.c
index 23c95871ee..ac2cc30be0 100644
--- a/src/change.c
+++ b/src/change.c
@@ -1008,10 +1008,7 @@ ins_char_bytes(char_u *buf, int charlen)
// show the match for right parens and braces.
if (p_sm && (State & INSERT)
&& msg_silent == 0
-#ifdef FEAT_INS_EXPAND
- && !ins_compl_active()
-#endif
- )
+ && !ins_compl_active())
{
if (has_mbyte)
showmatch(mb_ptr2char(buf));
diff --git a/src/charset.c b/src/charset.c
index 50ca617dc2..d47ccfd691 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -314,8 +314,6 @@ trans_characters(
}
}
-#if defined(FEAT_EVAL) || defined(FEAT_TITLE) || defined(FEAT_INS_EXPAND) \
- || defined(PROTO)
/*
* Translate a string into allocated memory, replacing special chars with
* printable chars. Returns NULL when out of memory.
@@ -382,9 +380,7 @@ transstr(char_u *s)
}
return res;
}
-#endif
-#if defined(FEAT_SYN_HL) || defined(FEAT_INS_EXPAND) || defined(PROTO)
/*
* Convert the string "str[orglen]" to do ignore-case comparing. Uses the
* current locale.
@@ -495,7 +491,6 @@ str_foldcase(
return (char_u *)ga.ga_data;
return buf;
}
-#endif
/*
* Catch 22: g_chartab[] can't be initialized before the options are
@@ -2015,6 +2010,7 @@ backslash_halve(char_u *p)
/*
* backslash_halve() plus save the result in allocated memory.
+ * However, returns "p" when out of memory.
*/
char_u *
backslash_halve_save(char_u *p)
diff --git a/src/edit.c b/src/edit.c
index 83b4be784d..cc41d49cc7 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -18,11 +18,9 @@
#define BACKSPACE_WORD_NOT_SPACE 3
#define BACKSPACE_LINE 4
-#ifdef FEAT_INS_EXPAND
/* Set when doing something for completion that may call edit() recursively,
* which is not allowed. */
static int compl_busy = FALSE;
-#endif /* FEAT_INS_EXPAND */
static void ins_ctrl_v(void);
@@ -194,7 +192,6 @@ edit(
return FALSE;
}
-#ifdef FEAT_INS_EXPAND
/* Don't allow recursive insert mode when busy with completion. */
if (ins_compl_active() || compl_busy || pum_visible())
{
@@ -202,7 +199,6 @@ edit(
return FALSE;
}
ins_compl_clear(); /* clear stuff for CTRL-X mode */
-#endif
/*
* Trigger InsertEnter autocommands. Do not do this for "r<CR>" or "grx".
@@ -462,11 +458,7 @@ edit(
if (update_Insstart_orig)
Insstart_orig = Insstart;
- if (stop_insert_mode
-#ifdef FEAT_INS_EXPAND
- && !pum_visible()
-#endif
- )
+ if (stop_insert_mode && !pum_visible())
{
/* ":stopinsert" used or 'insertmode' reset */
count = 0;
@@ -631,7 +623,6 @@ edit(
c = hkmap(c); /* Hebrew mode mapping */
#endif
-#ifdef FEAT_INS_EXPAND
/*
* Special handling of keys while the popup menu is visible or wanted
* and the cursor is still in the completed word. Only when there is
@@ -701,7 +692,6 @@ edit(
ins_compl_init_get_longest();
if (ins_compl_prep(c))
continue;
-#endif
/* CTRL-\ CTRL-N goes to Normal mode,
* CTRL-\ CTRL-G goes to mode selected with 'insertmode',
@@ -740,10 +730,8 @@ edit(
c = do_digraph(c);
#endif
-#ifdef FEAT_INS_EXPAND
if ((c == Ctrl_V || c == Ctrl_Q) && ctrl_x_mode_cmdline())
goto docomplete;
-#endif
if (c == Ctrl_V || c == Ctrl_Q)
{
ins_ctrl_v();
@@ -752,11 +740,7 @@ edit(
}
#ifdef FEAT_CINDENT
- if (cindent_on()
-# ifdef FEAT_INS_EXPAND
- && ctrl_x_mode_none()
-# endif
- )
+ if (cindent_on() && ctrl_x_mode_none())
{
/* A key name preceded by a bang means this key is not to be
* inserted. Skip ahead to the re-indenting below.
@@ -950,21 +934,20 @@ doESCkey:
#endif
case Ctrl_D: /* Make indent one shiftwidth smaller. */
-#if defined(FEAT_INS_EXPAND) && defined(FEAT_FIND_ID)
+#if defined(FEAT_FIND_ID)
if (ctrl_x_mode_path_defines())
goto docomplete;
#endif
/* FALLTHROUGH */
case Ctrl_T: /* Make indent one shiftwidth greater. */
-# ifdef FEAT_INS_EXPAND
if (c == Ctrl_T && ctrl_x_mode_thesaurus())
{
if (has_compl_option(FALSE))
goto docomplete;
break;
}
-# endif
+
ins_shift(c, lastc);
auto_format(FALSE, TRUE);
inserted_space = FALSE;
@@ -1131,10 +1114,8 @@ doESCkey:
break;
case K_UP: /* <Up> */
-#ifdef FEAT_INS_EXPAND
if (pum_visible())
goto docomplete;
-#endif
if (mod_mask & MOD_MASK_SHIFT)
ins_pageup();
else
@@ -1144,18 +1125,14 @@ doESCkey:
case K_S_UP: /* <S-Up> */
case K_PAGEUP:
case K_KPAGEUP:
-#ifdef FEAT_INS_EXPAND
if (pum_visible())
goto docomplete;
-#endif
ins_pageup();
break;
case K_DOWN: /* <Down> */
-#ifdef FEAT_INS_EXPAND
if (pum_visible())
goto docomplete;
-#endif
if (mod_mask & MOD_MASK_SHIFT)
ins_pagedown();
else
@@ -1165,10 +1142,8 @@ doESCkey:
case K_S_DOWN: /* <S-Down> */
case K_PAGEDOWN:
case K_KPAGEDOWN:
-#ifdef FEAT_INS_EXPAND
if (pum_visible())
goto docomplete;
-#endif
ins_pagedown();
break;
@@ -1183,7 +1158,7 @@ doESCkey:
/* FALLTHROUGH */
case TAB: /* TAB or Complete patterns along path */
-#if defined(FEAT_INS_EXPAND) && defined(FEAT_FIND_ID)
+#if defined(FEAT_FIND_ID)
if (ctrl_x_mode_path_patterns())
goto docomplete;
#endif
@@ -1235,25 +1210,20 @@ doESCkey:
inserted_space = FALSE;
break;
-#if defined(FEAT_DIGRAPHS) || defined(FEAT_INS_EXPAND)
case Ctrl_K: /* digraph or keyword completion */
-# ifdef FEAT_INS_EXPAND
if (ctrl_x_mode_dictionary())
{
if (has_compl_option(TRUE))
goto docomplete;
break;
}
-# endif
-# ifdef FEAT_DIGRAPHS
+#ifdef FEAT_DIGRAPHS
c = ins_digraph();
if (c == NUL)
break;
-# endif
- goto normalchar;
#endif
+ goto normalchar;
-#ifdef FEAT_INS_EXPAND
case Ctrl_X: /* Enter CTRL-X mode */
ins_ctrl_x();
break;
@@ -1273,12 +1243,9 @@ doESCkey:
if (!ctrl_x_mode_spell())
goto normalchar;
goto docomplete;
-#endif
case Ctrl_L: /* Whole line completion after ^X */
-#ifdef FEAT_INS_EXPAND
if (!ctrl_x_mode_whole_line())
-#endif
{
/* CTRL-L with 'insertmode' set: Leave Insert mode */
if (p_im)
@@ -1289,7 +1256,6 @@ doESCkey:
}
goto normalchar;
}
-#ifdef FEAT_INS_EXPAND
/* FALLTHROUGH */
case Ctrl_P: /* Do previous/next pattern completion */
@@ -1313,7 +1279,6 @@ docomplete:
#endif
compl_busy = FALSE;
break;
-#endif /* FEAT_INS_EXPAND */
case Ctrl_Y: /* copy from previous line or scroll down */
case Ctrl_E: /* copy from next line or scroll up */
@@ -1419,11 +1384,7 @@ normalchar:
inserted_space = FALSE;
#ifdef FEAT_CINDENT
- if (can_cindent && cindent_on()
-# ifdef FEAT_INS_EXPAND
- && ctrl_x_mode_normal()
-# endif
- )
+ if (can_cindent && cindent_on() && ctrl_x_mode_normal())
{
force_cindent:
/*
@@ -1478,10 +1439,7 @@ ins_redraw(int ready) // not busy with something
# endif
)
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor)
-# ifdef FEAT_INS_EXPAND
- && !pum_visible()
-# endif
- )
+ && !pum_visible())
{
# ifdef FEAT_SYN_HL
/* Need to update the screen first, to make sure syntax
@@ -1516,10 +1474,7 @@ ins_redraw(int ready) // not busy with something
/* Trigger TextChangedI if b_changedtick differs. */
if (ready && has_textchangedI()
&& curbuf->b_last_changedtick != CHANGEDTICK(curbuf)
-#ifdef FEAT_INS_EXPAND
- && !pum_visible()
-#endif
- )
+ && !pum_visible())
{
aco_save_T aco;
varnumber_T tick = CHANGEDTICK(curbuf);
@@ -1534,7 +1489,6 @@ ins_redraw(int ready) // not busy with something
(linenr_T)(curwin->w_cursor.lnum + 1));
}
-#ifdef FEAT_INS_EXPAND
/* Trigger TextChangedP if b_changedtick differs. When the popupmenu closes
* TextChangedI will need to trigger for backwards compatibility, thus use
* different b_last_changedtick* variables. */
@@ -1554,7 +1508,6 @@ ins_redraw(int ready) // not busy with something
u_save(curwin->w_cursor.lnum,
(linenr_T)(curwin->w_cursor.lnum + 1));
}
-#endif
#if defined(FEAT_CONCEAL)
if ((conceal_update_lines
@@ -4328,10 +4281,8 @@ ins_ctrl_g(void)
{
int c;
-#ifdef FEAT_INS_EXPAND
- /* Right after CTRL-X the cursor will be after the ruler. */
+ // Right after CTRL-X the cursor will be after the ruler.
setcursor();
-#endif
/*
* Don't map the second key. This also prevents the mode message to be
@@ -5253,9 +5204,7 @@ ins_mousescroll(int dir)
{
pos_T tpos;
win_T *old_curwin = curwin, *wp;
-# ifdef FEAT_INS_EXPAND
int did_scroll = FALSE;
-# endif
tpos = curwin->w_cursor;
@@ -5276,10 +5225,8 @@ ins_mousescroll(int dir)
if (curwin == old_curwin)
undisplay_dollar();
-# ifdef FEAT_INS_EXPAND
/* Don't scroll the window in which completion is being done. */
if (!pum_visible() || curwin != old_curwin)
-# endif
{
if (dir == MSCR_DOWN || dir == MSCR_UP)
{
@@ -5306,9 +5253,7 @@ ins_mousescroll(int dir)
gui_do_horiz_scroll(val, TRUE);
}
#endif
-# ifdef FEAT_INS_EXPAND
did_scroll = TRUE;
-# endif
}
curwin->w_redr_status = TRUE;
@@ -5316,7 +5261,6 @@ ins_mousescroll(int dir)
curwin = old_curwin;
curbuf = curwin->w_buffer;
-# ifdef FEAT_INS_EXPAND
/* The popup menu may overlay the window, need to redraw it.
* TODO: Would be more efficient to only redraw the windows that are
* overlapped by the popup menu. */
@@ -5325,7 +5269,6 @@ ins_mousescroll(int dir)
redraw_all_later(NOT_VALID);
ins_compl_show_pum();
}
-# endif
if (!EQUAL_POS(curwin->w_cursor, tpos))
{
@@ -6256,7 +6199,6 @@ ins_ctrl_ey(int tc)
{
int c = tc;
-#ifdef FEAT_INS_EXPAND
if (ctrl_x_mode_scroll())
{
if (c == Ctrl_Y)
@@ -6266,7 +6208,6 @@ ins_ctrl_ey(int tc)
redraw_later(VALID);
}
else
-#endif
{
c = ins_copychar(curwin->w_cursor.lnum + (c == Ctrl_Y ? -1 : 1));
if (c != NUL)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 2f66b173a9..d2a0c64bdc 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -499,12 +499,10 @@ static funcentry_T global_functions[] =
{"cindent", 1, 1, 0, f_cindent},
{"clearmatches", 0, 1, 0, f_clearmatches},
{"col", 1, 1, 0, f_col},
-#if defined(FEAT_INS_EXPAND)
{"complete", 2, 2, 0, f_complete},
{"complete_add", 1, 1, 0, f_complete_add},
{"complete_check", 0, 0, 0, f_complete_check},
{"complete_info", 0, 1, 0, f_complete_info},
-#endif
{"confirm", 1, 4, 0, f_confirm},
{"copy", 1, 1, FEARG_1, f_copy},
#ifdef FEAT_FLOAT
@@ -5951,9 +5949,7 @@ f_has(typval_T *argvars, typval_T *rettv)
#if defined(HAVE_ICONV_H) && defined(USE_ICONV)
"iconv",
#endif
-#ifdef FEAT_INS_EXPAND
"insert_expand",
-#endif
#ifdef FEAT_JOB_CHANNEL
"job",
#endif
@@ -7638,12 +7634,10 @@ f_mode(typval_T *argvars, typval_T *rettv)
buf[0] = 'R';
else
buf[0] = 'i';
-#ifdef FEAT_INS_EXPAND
if (ins_compl_active())
buf[1] = 'c';
else if (ctrl_x_mode_not_defined_yet())
buf[1] = 'x';
-#endif
}
}
else if ((State & CMDLINE) || exmode_active)
@@ -7886,9 +7880,7 @@ f_pum_getpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
if (rettv_dict_alloc(rettv) != OK)
return;
-#ifdef FEAT_INS_EXPAND
pum_set_event_info(rettv->vval.v_dict);
-#endif
}
/*
@@ -7897,10 +7889,8 @@ f_pum_getpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
static void
f_pumvisible(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
-#ifdef FEAT_INS_EXPAND
if (pum_visible())
rettv->vval.v_number = 1;
-#endif
}
#ifdef FEAT_PYTHON3
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 77d39434f5..ee3291c110 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4391,12 +4391,10 @@ do_sub(exarg_T *eap)
subflags.do_ask = FALSE;
break;
}
-#ifdef FEAT_INS_EXPAND
if (typed == Ctrl_E)
scrollup_clamp();
else if (typed == Ctrl_Y)
scrolldown_clamp();
-#endif
}
State = save_State;
#ifdef FEAT_MOUSE
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 6418ffe904..5d1c8efb7f 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4040,11 +4040,9 @@ open_cmdwin(void)
/* Don't execute autocommands while creating the window. */
block_autocmds();
-#if defined(FEAT_INS_EXPAND)
// When using completion in Insert mode with <C-R>=<C-F> one can open the
// command line window, but we don't want the popup menu then.
pum_undisplay();
-#endif
/* don't use a new tab page */
cmdmod.tab = 0;
diff --git a/src/feature.h b/src/feature.h
index 1c5128a7d6..8afa98797a 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -106,6 +106,7 @@
* +user_commands Allow the user to define his own commands.
* +multi_byte Generic multi-byte character handling.
* +cmdline_compl completion of mappings/abbreviations in cmdline mode.
+ * +insert_expand CTRL-N/CTRL-P/CTRL-X in insert mode.
*
* Obsolete:
* +tag_old_static Old style static tags: "file:tag file ..".
@@ -170,14 +171,6 @@
# define FEAT_KEYMAP
#endif
-/*
- * +insert_expand CTRL-N/CTRL-P/CTRL-X in insert mode. Takes about
- * 4Kbyte of code.
- */
-#ifdef FEAT_NORMAL
-# define FEAT_INS_EXPAND
-#endif
-
#ifdef FEAT_NORMAL
# define VIM_BACKTICK /* internal backtick expansion */
#endif
@@ -343,7 +336,7 @@
/*
* Insert mode completion with 'completefunc'.
*/
-#if defined(FEAT_INS_EXPAND) && defined(FEAT_EVAL)
+#if defined(FEAT_EVAL)
# define FEAT_COMPL_FUNC
#endif
@@ -621,7 +614,7 @@
/*
* popup menu in a terminal
*/
-#if defined(FEAT_MENU) && !defined(ALWAYS_USE_GUI) && defined(FEAT_INS_EXPAND)
+#if defined(FEAT_MENU) && !defined(ALWAYS_USE_GUI)
# define FEAT_TERM_POPUP_MENU
#endif
diff --git a/src/getchar.c b/src/getchar.c
index 2fb8438e85..eeb33420bc 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1481,7 +1481,6 @@ close_all_scripts(void)
}
#endif
-#if defined(FEAT_INS_EXPAND) || defined(PROTO)
/*
* Return TRUE when reading keys from a script file.
*/
@@ -1490,7 +1489,6 @@ using_script(void)
{
return scriptin[curscript] != NULL;
}
-#endif
/*
* This function is called just before doing a blocking wait. Thus after
@@ -1866,7 +1864,6 @@ vpeekc_nomap(void)
}
#endif
-#if defined(FEAT_INS_EXPAND) || defined(FEAT_EVAL) || defined(PROTO)
/*
* Check if any character is available, also half an escape sequence.
* Trick: when no typeahead found, but there is something in the typeahead
@@ -1882,7 +1879,6 @@ vpeekc_any(void)
c = ESC;
return c;
}
-#endif
/*
* Call vpeekc() without causing anything to be mapped.
@@ -1963,12 +1959,9 @@ handle_mapping(
&& !(State == HITRETURN && (tb_c1 == CAR || tb_c1 == ' '))
&& State != ASKMORE
&& State != CONFIRM
-#ifdef FEAT_INS_EXPAND
&& !((ctrl_x_mode_not_default() && vim_is_ctrl_x_key(tb_c1))
|| ((compl_cont_status & CONT_LOCAL)
- && (tb_c1 == Ctrl_N || tb_c1 == Ctrl_P)))
-#endif
- )
+ && (tb_c1 == Ctrl_N || tb_c1 == Ctrl_P))))
{
#ifdef FEAT_LANGMAP
if (tb_c1 == K_SPECIAL)
diff --git a/src/globals.h b/src/globals.h
index 61cb2b2839..d0837d3ff2 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -129,7 +129,6 @@ EXTERN int screen_cleared INIT(= FALSE); // screen has been cleared
*/
EXTERN colnr_T dollar_vcol INIT(= -1);
-#ifdef FEAT_INS_EXPAND
/*
* Variables for Insert mode completion.
*/
@@ -150,7 +149,11 @@ EXTERN int compl_cont_status INIT(= 0);
// word-wise expansion, not set for ^X^L
# define CONT_LOCAL 32 // for ctrl_x_mode 0, ^X^P/^X^N do a local
// expansion, (eg use complete=.)
-#endif
+
+EXTERN char_u *edit_submode INIT(= NULL); // msg for CTRL-X submode
+EXTERN char_u *edit_submode_pre INIT(= NULL); // prepended to edit_submode
+EXTERN char_u *edit_submode_extra INIT(= NULL);// appended to edit_submode
+EXTERN hlf_T edit_submode_highl; // highl. method for extra info
/*
* Functions for putting characters in the command line,
@@ -987,12 +990,6 @@ EXTERN int arrow_used; // Normally FALSE, set to TRUE after
// to call u_sync()
EXTERN int ins_at_eol INIT(= FALSE); // put cursor after eol when
// restarting edit after CTRL-O
-#ifdef FEAT_INS_EXPAND
-EXTERN char_u *edit_submode INIT(= NULL); // msg for CTRL-X submode
-EXTERN char_u *edit_submode_pre INIT(= NULL); // prepended to edit_submode
-EXTERN char_u *edit_submode_extra INIT(= NULL);// appended to edit_submode
-EXTERN hlf_T edit_submode_highl; // highl. method for extra info
-#endif
EXTERN int no_abbr INIT(= TRUE); // TRUE when no abbreviations loaded
@@ -1532,9 +1529,7 @@ EXTERN char e_openerrf[] INIT(= N_("E40: Can't open errorfile %s"));
EXTERN char e_opendisp[] INIT(= N_("E233: cannot open display"));
#endif
EXTERN char e_outofmem[] INIT(= N_("E41: Out of memory!"));
-#ifdef FEAT_INS_EXPAND
-EXTERN char e_patnotf[] INIT(= N_("Pattern not found"));
-#endif
+EXTERN char e_patnotf[] INIT(= N_("Pattern not found"));
EXTERN char e_patnotf2[] INIT(= N_("E486: Pattern not found: %s"));
EXTERN char e_positive[] INIT(= N_("E487: Argument must be positive"));
#if defined(UNIX) || defined(FEAT_SESSION)
@@ -1609,8 +1604,7 @@ EXTERN char e_nobufnr[] INIT(= N_("E86: Buffer %ld does not exist"));