patch 9.0.0222: no good reason why text objects are only in larger builds
Problem: No good reason why text objects are only in larger builds.
Solution: Graduate +textobjects.
diff --git a/src/buffer.c b/src/buffer.c
index 1aaddd4..203238f 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2372,9 +2372,7 @@
#endif
clear_string_option(&buf->b_p_dict);
clear_string_option(&buf->b_p_tsr);
-#ifdef FEAT_TEXTOBJ
clear_string_option(&buf->b_p_qe);
-#endif
buf->b_p_ar = -1;
buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
clear_string_option(&buf->b_p_lw);
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 3817352..a5c8a7d 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -6200,13 +6200,7 @@
0
#endif
},
- {"textobjects",
-#ifdef FEAT_TEXTOBJ
- 1
-#else
- 0
-#endif
- },
+ {"textobjects", 1},
{"textprop",
#ifdef FEAT_PROP_POPUP
1
diff --git a/src/feature.h b/src/feature.h
index b02bb9c..d594171 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -114,6 +114,7 @@
* +lispindent lisp indenting (From Eric Fischer).
* +cindent C code indenting (From Eric Fischer).
* +smartindent smart C code indenting when the 'si' option is set.
+ * +textobjects Text objects: "vaw", "das", etc.
*
* Obsolete:
* +tag_old_static Old style static tags: "file:tag file ..".
@@ -302,13 +303,6 @@
#endif
/*
- * +textobjects Text objects: "vaw", "das", etc.
- */
-#if defined(FEAT_NORMAL) && defined(FEAT_EVAL)
-# define FEAT_TEXTOBJ
-#endif
-
-/*
* Insert mode completion with 'completefunc'.
*/
#if defined(FEAT_EVAL)
diff --git a/src/misc2.c b/src/misc2.c
index e17a6f1..38dcb48 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -650,7 +650,6 @@
}
}
-#if defined(FEAT_TEXTOBJ) || defined(PROTO)
/*
* Make sure curwin->w_cursor is not on the NUL at the end of the line.
* Allow it when in Visual mode and 'selection' is not "old".
@@ -663,7 +662,6 @@
&& gchar_cursor() == NUL)
--curwin->w_cursor.col;
}
-#endif
/*
* When curwin->w_leftcol has changed, adjust the cursor position.
diff --git a/src/normal.c b/src/normal.c
index ee3ad98..b1335a0 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -109,9 +109,7 @@
static void nv_esc(cmdarg_T *oap);
static void nv_edit(cmdarg_T *cap);
static void invoke_edit(cmdarg_T *cap, int repl, int cmd, int startln);
-#ifdef FEAT_TEXTOBJ
static void nv_object(cmdarg_T *cap);
-#endif
static void nv_record(cmdarg_T *cap);
static void nv_at(cmdarg_T *cap);
static void nv_halfpage(cmdarg_T *cap);
@@ -6888,11 +6886,7 @@
else if ((cap->cmdchar == 'a' || cap->cmdchar == 'i')
&& (cap->oap->op_type != OP_NOP || VIsual_active))
{
-#ifdef FEAT_TEXTOBJ
nv_object(cap);
-#else
- clearopbeep(cap->oap);
-#endif
}
#ifdef FEAT_TERMINAL
else if (term_in_normal_mode())
@@ -7044,7 +7038,6 @@
restart_edit = restart_edit_save;
}
-#ifdef FEAT_TEXTOBJ
/*
* "a" or "i" while an operator is pending or in Visual mode: object motion.
*/
@@ -7091,6 +7084,7 @@
case '>':
flag = current_block(cap->oap, cap->count1, include, '<', '>');
break;
+#ifdef FEAT_EVAL
case 't': // "at" = a tag block (xml and html)
// Do not adjust oap->end in do_pending_operator()
// otherwise there are different results for 'dit'
@@ -7101,6 +7095,7 @@
cap->retval |= CA_NO_ADJ_OP_END;
flag = current_tagblock(cap->oap, cap->count1, include);
break;
+#endif
case 'p': // "ap" = a paragraph
flag = current_par(cap->oap, cap->count1, include, 'p');
break;
@@ -7129,7 +7124,6 @@
adjust_cursor_col();
curwin->w_set_curswant = TRUE;
}
-#endif
/*
* "q" command: Start/stop recording.
diff --git a/src/option.c b/src/option.c
index 26b09ca..f3c53b2 100644
--- a/src/option.c
+++ b/src/option.c
@@ -5514,9 +5514,7 @@
case PV_MOD: return (char_u *)&(curbuf->b_changed);
case PV_NF: return (char_u *)&(curbuf->b_p_nf);
case PV_PI: return (char_u *)&(curbuf->b_p_pi);
-#ifdef FEAT_TEXTOBJ
case PV_QE: return (char_u *)&(curbuf->b_p_qe);
-#endif
case PV_RO: return (char_u *)&(curbuf->b_p_ro);
case PV_SI: return (char_u *)&(curbuf->b_p_si);
case PV_SN: return (char_u *)&(curbuf->b_p_sn);
@@ -6132,10 +6130,8 @@
#ifdef FEAT_COMPL_FUNC
buf->b_p_tsrfu = empty_option;
#endif
-#ifdef FEAT_TEXTOBJ
buf->b_p_qe = vim_strsave(p_qe);
COPY_OPT_SCTX(buf, BV_QE);
-#endif
#if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
buf->b_p_bexpr = empty_option;
#endif
diff --git a/src/option.h b/src/option.h
index 5ac54ef..4d9f7e2 100644
--- a/src/option.h
+++ b/src/option.h
@@ -802,9 +802,7 @@
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
EXTERN long p_pyx; // 'pyxversion'
#endif
-#ifdef FEAT_TEXTOBJ
EXTERN char_u *p_qe; // 'quoteescape'
-#endif
EXTERN int p_ro; // 'readonly'
#ifdef FEAT_RELTIME
EXTERN long p_rdt; // 'redrawtime'
@@ -1183,9 +1181,7 @@
#endif
, BV_PATH
, BV_PI
-#ifdef FEAT_TEXTOBJ
, BV_QE
-#endif
, BV_RO
, BV_SI
, BV_SN
diff --git a/src/optiondefs.h b/src/optiondefs.h
index 912209c..be9a86e 100644
--- a/src/optiondefs.h
+++ b/src/optiondefs.h
@@ -108,9 +108,7 @@
#endif
#define PV_PATH OPT_BOTH(OPT_BUF(BV_PATH))
#define PV_PI OPT_BUF(BV_PI)
-#ifdef FEAT_TEXTOBJ
-# define PV_QE OPT_BUF(BV_QE)
-#endif
+#define PV_QE OPT_BUF(BV_QE)
#define PV_RO OPT_BUF(BV_RO)
#define PV_SI OPT_BUF(BV_SI)
#define PV_SN OPT_BUF(BV_SN)
@@ -2009,14 +2007,8 @@
#endif
SCTX_INIT},
{"quoteescape", "qe", P_STRING|P_ALLOCED|P_VI_DEF,
-#ifdef FEAT_TEXTOBJ
(char_u *)&p_qe, PV_QE,
- {(char_u *)"\\", (char_u *)0L}
-#else
- (char_u *)NULL, PV_NONE,
- {(char_u *)NULL, (char_u *)0L}
-#endif
- SCTX_INIT},
+ {(char_u *)"\\", (char_u *)0L} SCTX_INIT},
{"readonly", "ro", P_BOOL|P_VI_DEF|P_RSTAT|P_NOGLOB,
(char_u *)&p_ro, PV_RO,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
diff --git a/src/optionstr.c b/src/optionstr.c
index faf6235..4fbfcc9 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -242,9 +242,7 @@
check_string_option(&buf->b_p_cms);
#endif
check_string_option(&buf->b_p_nf);
-#ifdef FEAT_TEXTOBJ
check_string_option(&buf->b_p_qe);
-#endif
#ifdef FEAT_SYN_HL
check_string_option(&buf->b_p_syn);
check_string_option(&buf->b_s.b_syn_isk);
diff --git a/src/scriptfile.c b/src/scriptfile.c
index 053dd06..76c78e7 100644
--- a/src/scriptfile.c
+++ b/src/scriptfile.c
@@ -1378,6 +1378,7 @@
int sid;
scriptitem_T *si = NULL;
int save_estack_compiling = estack_compiling;
+ ESTACK_CHECK_DECLARATION
#endif
#ifdef STARTUPTIME
struct timeval tv_rel;
@@ -1388,7 +1389,6 @@
#endif
int save_sticky_cmdmod_flags = sticky_cmdmod_flags;
int trigger_source_post = FALSE;
- ESTACK_CHECK_DECLARATION
CLEAR_FIELD(cookie);
if (fname == NULL)
@@ -1693,7 +1693,9 @@
if (got_int)
emsg(_(e_interrupted));
+#ifdef FEAT_EVAL
ESTACK_CHECK_NOW
+#endif
estack_pop();
if (p_verbose > 1)
{
diff --git a/src/structs.h b/src/structs.h
index 242c4b7..39c5ef2 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -2959,9 +2959,7 @@
int b_p_ma; // 'modifiable'
char_u *b_p_nf; // 'nrformats'
int b_p_pi; // 'preserveindent'
-#ifdef FEAT_TEXTOBJ
char_u *b_p_qe; // 'quoteescape'
-#endif
int b_p_ro; // 'readonly'
long b_p_sw; // 'shiftwidth'
int b_p_sn; // 'shortname'
diff --git a/src/testdir/test_textobjects.vim b/src/testdir/test_textobjects.vim
index b605d76..746b326 100644
--- a/src/testdir/test_textobjects.vim
+++ b/src/testdir/test_textobjects.vim
@@ -1,7 +1,6 @@
" Test for textobjects
source check.vim
-CheckFeature textobjects
func CpoM(line, useM, expected)
new
diff --git a/src/textobject.c b/src/textobject.c
index 41b6a29..d77ec96 100644
--- a/src/textobject.c
+++ b/src/textobject.c
@@ -614,7 +614,6 @@
return FALSE;
}
-#if defined(FEAT_TEXTOBJ) || defined(PROTO)
/*
* Go back to the start of the word or the start of white space
*/
@@ -1189,6 +1188,7 @@
return OK;
}
+#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Return TRUE if the cursor is on a "<aaa>" tag. Ignore "<aaa/>".
* When "end_tag" is TRUE return TRUE if the cursor is on "</aaa>".
@@ -1470,6 +1470,7 @@
p_ws = save_p_ws;
return retval;
}
+#endif
int
current_par(
@@ -2001,5 +2002,3 @@
}
return FALSE;
}
-
-#endif // FEAT_TEXTOBJ
diff --git a/src/version.c b/src/version.c
index 03d641f..968a199 100644
--- a/src/version.c
+++ b/src/version.c
@@ -614,11 +614,7 @@
#else
"-termresponse",
#endif
-#ifdef FEAT_TEXTOBJ
"+textobjects",
-#else
- "-textobjects",
-#endif
#ifdef FEAT_PROP_POPUP
"+textprop",
#else
@@ -736,6 +732,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 222,
+/**/
221,
/**/
220,