From 887748742deae3d6de7aa0fdbb042afe1ccf5e7a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 16 Aug 2022 20:24:29 +0100 Subject: 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. --- src/buffer.c | 2 -- src/evalfunc.c | 8 +------- src/feature.h | 8 +------- src/misc2.c | 2 -- src/normal.c | 10 ++-------- src/option.c | 4 ---- src/option.h | 4 ---- src/optiondefs.h | 12 ++---------- src/optionstr.c | 2 -- src/scriptfile.c | 4 +++- src/structs.h | 2 -- src/testdir/test_textobjects.vim | 1 - src/textobject.c | 5 ++--- src/version.c | 6 ++---- 14 files changed, 13 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/buffer.c b/src/buffer.c index 1aaddd477b..203238ff78 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2372,9 +2372,7 @@ free_buf_options( #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 3817352ca3..a5c8a7d23b 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -6200,13 +6200,7 @@ f_has(typval_T *argvars, typval_T *rettv) 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 b02bb9c554..d594171ad1 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 ..". @@ -301,13 +302,6 @@ # define FEAT_TIMERS #endif -/* - * +textobjects Text objects: "vaw", "das", etc. - */ -#if defined(FEAT_NORMAL) && defined(FEAT_EVAL) -# define FEAT_TEXTOBJ -#endif - /* * Insert mode completion with 'completefunc'. */ diff --git a/src/misc2.c b/src/misc2.c index e17a6f1ead..38dcb48d17 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -650,7 +650,6 @@ check_visual_pos(void) } } -#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 @@ adjust_cursor_col(void) && 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 ee3ad986ff..b1335a0373 100644 --- a/src/normal.c +++ b/src/normal.c @@ -109,9 +109,7 @@ static void nv_normal(cmdarg_T *cap); 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 @@ nv_edit(cmdarg_T *cap) 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 @@ invoke_edit( 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 @@ nv_object( 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 @@ nv_object( 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 @@ nv_object( 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 26b09caf6f..f3c53b2282 100644 --- a/src/option.c +++ b/src/option.c @@ -5514,9 +5514,7 @@ get_varp(struct vimoption *p) 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 @@ buf_copy_options(buf_T *buf, int flags) #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 5ac54efc6d..4d9f7e2327 100644 --- a/src/option.h +++ b/src/option.h @@ -802,9 +802,7 @@ EXTERN char_u *p_pyhome; // 'pythonhome' #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 @@ enum #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 912209c025..be9a86e44e 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 @@ static struct vimoption options[] = #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 faf62357a9..4fbfcc9b1d 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -242,9 +242,7 @@ check_buf_options(buf_T *buf) 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 053dd06472..76c78e7548 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -1378,6 +1378,7 @@ do_source_ext( 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 @@ do_source_ext( #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 @@ do_source_ext( 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 242c4b7b11..39c5ef2fc7 100644 --- a/src/structs.h +++ b/src/structs.h @@ -2959,9 +2959,7 @@ struct file_buffer 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 b605d76f2f..746b3268b2 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 41b6a29e3d..d77ec961ab 100644 --- a/src/textobject.c +++ b/src/textobject.c @@ -614,7 +614,6 @@ skip_chars(int cclass, int dir) 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 @@ current_block( return OK; } +#if defined(FEAT_EVAL) || defined(PROTO) /* * Return TRUE if the cursor is on a "" tag. Ignore "". * When "end_tag" is TRUE return TRUE if the cursor is on "". @@ -1470,6 +1470,7 @@ theend: p_ws = save_p_ws; return retval; } +#endif int current_par( @@ -2001,5 +2002,3 @@ abort_search: } return FALSE; } - -#endif // FEAT_TEXTOBJ diff --git a/src/version.c b/src/version.c index 03d641fd77..968a199b79 100644 --- a/src/version.c +++ b/src/version.c @@ -614,11 +614,7 @@ static char *(features[]) = #else "-termresponse", #endif -#ifdef FEAT_TEXTOBJ "+textobjects", -#else - "-textobjects", -#endif #ifdef FEAT_PROP_POPUP "+textprop", #else @@ -735,6 +731,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 222, /**/ 221, /**/ -- cgit v1.2.3