]> granicus.if.org Git - vim/commitdiff
patch 9.0.0222: no good reason why text objects are only in larger builds v9.0.0222
authorBram Moolenaar <Bram@vim.org>
Tue, 16 Aug 2022 19:24:29 +0000 (20:24 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 16 Aug 2022 19:24:29 +0000 (20:24 +0100)
Problem:    No good reason why text objects are only in larger builds.
Solution:   Graduate +textobjects.

16 files changed:
runtime/doc/motion.txt
runtime/doc/various.txt
src/buffer.c
src/evalfunc.c
src/feature.h
src/misc2.c
src/normal.c
src/option.c
src/option.h
src/optiondefs.h
src/optionstr.c
src/scriptfile.c
src/structs.h
src/testdir/test_textobjects.vim
src/textobject.c
src/version.c

index 9d6142ba5ca5a833acaeb7d4644b36270fd8df4e..4253684d1a08b5d4bfeafe0486bfbe50cca0e240 100644 (file)
@@ -532,8 +532,6 @@ including white space, the commands starting with "i" select an "inner" object
 without white space, or just the white space.  Thus the "inner" commands
 always select less text than the "a" commands.
 
-These commands are not available when the |+textobjects| feature has been
-disabled at compile time.
 Also see `gn` and `gN`, operating on the last search pattern.
 
                                                        *v_aw* *aw*
@@ -634,6 +632,7 @@ at                  "a tag block", select [count] tag blocks, from the
                        "</aaa>", including the "<aaa>" and "</aaa>".
                        See |tag-blocks| about the details.
                        When used in Visual mode it is made characterwise.
+                       Only available when compiled with the |+eval| feature.
 
                                                *v_it* *it*
 it                     "inner tag block", select [count] tag blocks, from the
index e916abde47778930da892d3b5dc47d9881d0146b..13e73e3435eef89854dee2f0c857c70b97281389 100644 (file)
@@ -470,7 +470,7 @@ m  *+terminal*              Support for terminal window |terminal|
    *+terminfo*         uses |terminfo| instead of termcap
 N  *+termresponse*     support for |t_RV| and |v:termresponse|
 B  *+termguicolors*    24-bit color in xterm-compatible terminals support
-N  *+textobjects*      |text-objects| selection
+T  *+textobjects*      |text-objects| selection. Always enabled since 9.0.0222.
 N  *+textprop*         |text-properties|
    *+tgetent*          non-Unix only: able to use external termcap
 N  *+timers*           the |timer_start()| function
index 1aaddd477bb443400a9540357758534ac38453a8..203238ff7821500e3d7928b9f6e544a9c5a3dbcf 100644 (file)
@@ -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);
index 3817352ca3cf7c28421e2b0986d9fc1cbe8c2d00..a5c8a7d23b24414f61785b2a6b22d06d9344ac0d 100644 (file)
@@ -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
index b02bb9c5549049e6f0fa90b9013ece91c4d47b51..d594171ad1922e4fbad40b7a7966be0a79adb7bb 100644 (file)
  * +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  ..".
 # 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'.
  */
index e17a6f1ead58e9f63715ed60beb22d72cadae437..38dcb48d178050eaeb69c246cada7330583948c4 100644 (file)
@@ -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.
index ee3ad986ff0dd4f473941dd940b3dae75d9733ae..b1335a0373a6b5d89ca4af6f11236e70f2964cb8 100644 (file)
@@ -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.
index 26b09caf6fc3579c0902dc29542fbd4ab18e656f..f3c53b2282c4c2f7165b2058c4f2327d30bde582 100644 (file)
@@ -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
index 5ac54efc6d4a41163cf85d031514c3c8c50e17bc..4d9f7e23275f5870589e4c08f2dc635ccf348fb6 100644 (file)
@@ -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
index 912209c025c94adb35cf93774e10bed5dade371c..be9a86e44edd946de812133a409d893f224e2003 100644 (file)
 #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},
index faf62357a9dc3479e146088131e22d3ae845d396..4fbfcc9b1dadaea0413cf0f87e421a9988b7982a 100644 (file)
@@ -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);
index 053dd0647237c37c323850e84edac72026cd71a2..76c78e75488b9e49997b3c294317ef63ca235b34 100644 (file)
@@ -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)
     {
index 242c4b7b1181d06ccc097a90310b7354e57e0aec..39c5ef2fc757a85dba92d4e721d4a5794429f26e 100644 (file)
@@ -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'
index b605d76f2fe0a54c206442081b6c344f8cf594c1..746b3268b2a1e0382d59a44772e1eb666efaa5d5 100644 (file)
@@ -1,7 +1,6 @@
 " Test for textobjects
 
 source check.vim
-CheckFeature textobjects
 
 func CpoM(line, useM, expected)
   new
index 41b6a29e3d0abf1cc441aa2c0a116af4d09ec452..d77ec961abae767edda7ff19b3bfd1b591f5cfcf 100644 (file)
@@ -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 "<aaa>" tag.  Ignore "<aaa/>".
  * When "end_tag" is TRUE return TRUE if the cursor is on "</aaa>".
@@ -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
index 03d641fd77f74b150d1177574ba9b98fa2c2d98e..968a199b793d5a3285c3d9c69871ff104d5a0d37 100644 (file)
@@ -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,
 /**/