]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.627
- add patches 7.3.619-743
[packages/vim.git] / 7.3.627
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.627
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.3.627
11 Problem:    When using the "n" flag with the ":s" command a \= substitution
12             will not be evaluated.
13 Solution:   Do perform the evaluation, so that a function can be invoked at
14             every matching position without changing the text. (Christian
15             Brabandt)
16 Files:      src/ex_cmds.c
17
18
19 *** ../vim-7.3.626/src/ex_cmds.c        2012-07-10 15:18:18.000000000 +0200
20 --- src/ex_cmds.c       2012-08-08 16:44:16.000000000 +0200
21 ***************
22 *** 4264,4269 ****
23 --- 4264,4272 ----
24       int               endcolumn = FALSE;      /* cursor in last column when done */
25       pos_T     old_cursor = curwin->w_cursor;
26       int               start_nsubs;
27 + #ifdef FEAT_EVAL
28 +     int         save_ma = 0;
29 + #endif
30   
31       cmd = eap->arg;
32       if (!global_busy)
33 ***************
34 *** 4668,4674 ****
35                     }
36                     sub_nsubs++;
37                     did_sub = TRUE;
38 !                   goto skip;
39                 }
40   
41                 if (do_ask)
42 --- 4671,4682 ----
43                     }
44                     sub_nsubs++;
45                     did_sub = TRUE;
46 ! #ifdef FEAT_EVAL
47 !                   /* Skip the substitution, unless an expression is used,
48 !                    * then it is evaluated in the sandbox. */
49 !                   if (!(sub[0] == '\\' && sub[1] == '='))
50 ! #endif
51 !                       goto skip;
52                 }
53   
54                 if (do_ask)
55 ***************
56 *** 4840,4849 ****
57 --- 4848,4874 ----
58                 /*
59                  * 3. substitute the string.
60                  */
61 + #ifdef FEAT_EVAL
62 +               if (do_count)
63 +               {
64 +                   /* prevent accidently changing the buffer by a function */
65 +                   save_ma = curbuf->b_p_ma;
66 +                   curbuf->b_p_ma = FALSE;
67 +                   sandbox++;
68 +               }
69 + #endif
70                 /* get length of substitution part */
71                 sublen = vim_regsub_multi(&regmatch,
72                                     sub_firstlnum - regmatch.startpos[0].lnum,
73                                     sub, sub_firstline, FALSE, p_magic, TRUE);
74 + #ifdef FEAT_EVAL
75 +               if (do_count)
76 +               {
77 +                   curbuf->b_p_ma = save_ma;
78 +                   sandbox--;
79 +                   goto skip;
80 +               }
81 + #endif
82   
83                 /* When the match included the "$" of the last line it may
84                  * go beyond the last line of the buffer. */
85 *** ../vim-7.3.626/src/version.c        2012-08-08 16:05:03.000000000 +0200
86 --- src/version.c       2012-08-08 16:48:45.000000000 +0200
87 ***************
88 *** 716,717 ****
89 --- 716,719 ----
90   {   /* Add new patch number below this line */
91 + /**/
92 +     627,
93   /**/
94
95 -- 
96 hundred-and-one symptoms of being an internet addict:
97 225. You sign up for free subscriptions for all the computer magazines
98
99  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
100 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
101 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
102  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.080143 seconds and 3 git commands to generate.