From e2c453d38f6512ac4cff7cd26aa7780b4e2534d7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 21 Aug 2019 14:37:09 +0200 Subject: 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. --- src/insexpand.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/insexpand.c') diff --git a/src/insexpand.c b/src/insexpand.c index a86630f62..280c2c6e4 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -13,7 +13,6 @@ #include "vim.h" -#ifdef FEAT_INS_EXPAND /* * Definitions used for CTRL-X submode. * Note: If you change CTRL-X submode, you must also maintain ctrl_x_msgs[] and @@ -209,14 +208,12 @@ static int ins_compl_pum_key(int c); static int ins_compl_key2count(int c); static void show_pum(int prev_w_wrow, int prev_w_leftcol); static unsigned quote_meta(char_u *dest, char_u *str, int len); -#endif // FEAT_INS_EXPAND #ifdef FEAT_SPELL static void spell_back_to_badword(void); static int spell_bad_len = 0; // length of located bad word #endif -#if defined(FEAT_INS_EXPAND) || defined(PROTO) /* * CTRL-X pressed in Insert mode. */ @@ -288,9 +285,9 @@ ctrl_x_mode_not_defined_yet(void) has_compl_option(int dict_opt) { if (dict_opt ? (*curbuf->b_p_dict == NUL && *p_dict == NUL -# ifdef FEAT_SPELL +#ifdef FEAT_SPELL && !curwin->w_p_spell -# endif +#endif ) : (*curbuf->b_p_tsr == NUL && *p_tsr == NUL)) { @@ -4154,15 +4151,15 @@ quote_meta(char_u *dest, char_u *src, int len) return m; } -# if defined(EXITFREE) || defined(PROTO) +#if defined(EXITFREE) || defined(PROTO) void free_insexpand_stuff(void) { VIM_CLEAR(compl_orig_text); } -# endif +#endif -# ifdef FEAT_SPELL +#ifdef FEAT_SPELL /* * Called when starting CTRL_X_SPELL mode: Move backwards to a previous badly * spelled word, if there is one. @@ -4176,6 +4173,4 @@ spell_back_to_badword(void) if (curwin->w_cursor.col != tpos.col) start_arrow(&tpos); } -# endif - -#endif // FEAT_INS_EXPAND +#endif -- cgit v1.2.1