diff src/ops.c @ 13380:69517d67421f v8.0.1564

patch 8.0.1564: too many #ifdefs commit https://github.com/vim/vim/commit/f2bd8ef2b4507d02c6043affff8f7e85e3414d5f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 4 18:08:14 2018 +0100 patch 8.0.1564: too many #ifdefs Problem: Too many #ifdefs. Solution: Graduate the +autocmd feature. Takes away 450 #ifdefs and increases code size of tiny Vim by only 40 Kbyte.
author Christian Brabandt <cb@256bit.org>
date Sun, 04 Mar 2018 18:15:08 +0100
parents 88cc06dc1a50
children bb789ed5113a
line wrap: on
line diff
--- a/src/ops.c
+++ b/src/ops.c
@@ -1651,7 +1651,7 @@ shift_delete_registers()
     y_regs[1].y_array = NULL;		/* set register one to empty */
 }
 
-#ifdef FEAT_AUTOCMD
+#if defined(FEAT_EVAL)
     static void
 yank_do_autocmd(oparg_T *oap, yankreg_T *reg)
 {
@@ -1866,7 +1866,7 @@ op_delete(oparg_T *oap)
 	    }
 	}
 
-#ifdef FEAT_AUTOCMD
+#if defined(FEAT_EVAL)
 	if (did_yank && has_textyankpost())
 	    yank_do_autocmd(oap, y_current);
 #endif
@@ -3350,7 +3350,7 @@ op_yank(oparg_T *oap, int deleting, int 
 # endif
 #endif
 
-#ifdef FEAT_AUTOCMD
+#if defined(FEAT_EVAL)
     if (!deleting && has_textyankpost())
 	yank_do_autocmd(oap, y_current);
 #endif
@@ -3493,11 +3493,9 @@ do_put(
 	    return;
     }
 
-#ifdef FEAT_AUTOCMD
     /* Autocommands may be executed when saving lines for undo, which may make
      * y_array invalid.  Start undo now to avoid that. */
     u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1);
-#endif
 
     if (insert_string != NULL)
     {