Karsten Hopp 1a2945
To: vim_dev@googlegroups.com
Karsten Hopp 1a2945
Subject: Patch 7.3.627
Karsten Hopp 1a2945
Fcc: outbox
Karsten Hopp 1a2945
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 1a2945
Mime-Version: 1.0
Karsten Hopp 1a2945
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 1a2945
Content-Transfer-Encoding: 8bit
Karsten Hopp 1a2945
------------
Karsten Hopp 1a2945
Karsten Hopp 1a2945
Patch 7.3.627
Karsten Hopp 1a2945
Problem:    When using the "n" flag with the ":s" command a \= substitution
Karsten Hopp 1a2945
	    will not be evaluated.
Karsten Hopp 1a2945
Solution:   Do perform the evaluation, so that a function can be invoked at
Karsten Hopp 1a2945
	    every matching position without changing the text. (Christian
Karsten Hopp 1a2945
	    Brabandt)
Karsten Hopp 1a2945
Files:	    src/ex_cmds.c
Karsten Hopp 1a2945
Karsten Hopp 1a2945
Karsten Hopp 1a2945
*** ../vim-7.3.626/src/ex_cmds.c	2012-07-10 15:18:18.000000000 +0200
Karsten Hopp 1a2945
--- src/ex_cmds.c	2012-08-08 16:44:16.000000000 +0200
Karsten Hopp 1a2945
***************
Karsten Hopp 1a2945
*** 4264,4269 ****
Karsten Hopp 1a2945
--- 4264,4272 ----
Karsten Hopp 1a2945
      int		endcolumn = FALSE;	/* cursor in last column when done */
Karsten Hopp 1a2945
      pos_T	old_cursor = curwin->w_cursor;
Karsten Hopp 1a2945
      int		start_nsubs;
Karsten Hopp 1a2945
+ #ifdef FEAT_EVAL
Karsten Hopp 1a2945
+     int         save_ma = 0;
Karsten Hopp 1a2945
+ #endif
Karsten Hopp 1a2945
  
Karsten Hopp 1a2945
      cmd = eap->arg;
Karsten Hopp 1a2945
      if (!global_busy)
Karsten Hopp 1a2945
***************
Karsten Hopp 1a2945
*** 4668,4674 ****
Karsten Hopp 1a2945
  		    }
Karsten Hopp 1a2945
  		    sub_nsubs++;
Karsten Hopp 1a2945
  		    did_sub = TRUE;
Karsten Hopp 1a2945
! 		    goto skip;
Karsten Hopp 1a2945
  		}
Karsten Hopp 1a2945
  
Karsten Hopp 1a2945
  		if (do_ask)
Karsten Hopp 1a2945
--- 4671,4682 ----
Karsten Hopp 1a2945
  		    }
Karsten Hopp 1a2945
  		    sub_nsubs++;
Karsten Hopp 1a2945
  		    did_sub = TRUE;
Karsten Hopp 1a2945
! #ifdef FEAT_EVAL
Karsten Hopp 1a2945
! 		    /* Skip the substitution, unless an expression is used,
Karsten Hopp 1a2945
! 		     * then it is evaluated in the sandbox. */
Karsten Hopp 1a2945
! 		    if (!(sub[0] == '\\' && sub[1] == '='))
Karsten Hopp 1a2945
! #endif
Karsten Hopp 1a2945
! 			goto skip;
Karsten Hopp 1a2945
  		}
Karsten Hopp 1a2945
  
Karsten Hopp 1a2945
  		if (do_ask)
Karsten Hopp 1a2945
***************
Karsten Hopp 1a2945
*** 4840,4849 ****
Karsten Hopp 1a2945
--- 4848,4874 ----
Karsten Hopp 1a2945
  		/*
Karsten Hopp 1a2945
  		 * 3. substitute the string.
Karsten Hopp 1a2945
  		 */
Karsten Hopp 1a2945
+ #ifdef FEAT_EVAL
Karsten Hopp 1a2945
+ 		if (do_count)
Karsten Hopp 1a2945
+ 		{
Karsten Hopp 1a2945
+ 		    /* prevent accidently changing the buffer by a function */
Karsten Hopp 1a2945
+ 		    save_ma = curbuf->b_p_ma;
Karsten Hopp 1a2945
+ 		    curbuf->b_p_ma = FALSE;
Karsten Hopp 1a2945
+ 		    sandbox++;
Karsten Hopp 1a2945
+ 		}
Karsten Hopp 1a2945
+ #endif
Karsten Hopp 1a2945
  		/* get length of substitution part */
Karsten Hopp 1a2945
  		sublen = vim_regsub_multi(&regmatch,
Karsten Hopp 1a2945
  				    sub_firstlnum - regmatch.startpos[0].lnum,
Karsten Hopp 1a2945
  				    sub, sub_firstline, FALSE, p_magic, TRUE);
Karsten Hopp 1a2945
+ #ifdef FEAT_EVAL
Karsten Hopp 1a2945
+ 		if (do_count)
Karsten Hopp 1a2945
+ 		{
Karsten Hopp 1a2945
+ 		    curbuf->b_p_ma = save_ma;
Karsten Hopp 1a2945
+ 		    sandbox--;
Karsten Hopp 1a2945
+ 		    goto skip;
Karsten Hopp 1a2945
+ 		}
Karsten Hopp 1a2945
+ #endif
Karsten Hopp 1a2945
  
Karsten Hopp 1a2945
  		/* When the match included the "$" of the last line it may
Karsten Hopp 1a2945
  		 * go beyond the last line of the buffer. */
Karsten Hopp 1a2945
*** ../vim-7.3.626/src/version.c	2012-08-08 16:05:03.000000000 +0200
Karsten Hopp 1a2945
--- src/version.c	2012-08-08 16:48:45.000000000 +0200
Karsten Hopp 1a2945
***************
Karsten Hopp 1a2945
*** 716,717 ****
Karsten Hopp 1a2945
--- 716,719 ----
Karsten Hopp 1a2945
  {   /* Add new patch number below this line */
Karsten Hopp 1a2945
+ /**/
Karsten Hopp 1a2945
+     627,
Karsten Hopp 1a2945
  /**/
Karsten Hopp 1a2945
Karsten Hopp 1a2945
-- 
Karsten Hopp 1a2945
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 1a2945
225. You sign up for free subscriptions for all the computer magazines
Karsten Hopp 1a2945
Karsten Hopp 1a2945
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 1a2945
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 1a2945
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 1a2945
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///