summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0887
blob: 9767f4948614c73d8c3b343f49b92b483139b1a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0887
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0887
Problem:    The 'l' flag in :subsitute is sticky.
Solution:   Reset the flag. (Dominique Pelle, closes #3925)
Files:	    src/ex_cmds.c, src/testdir/test_substitute.vim


*** ../vim-8.1.0886/src/ex_cmds.c	2019-02-08 14:33:54.818762019 +0100
--- src/ex_cmds.c	2019-02-10 21:52:20.042996065 +0100
***************
*** 2098,2104 ****
  			fp_out = NULL;
  # ifdef EEXIST
  			/* Avoid trying lots of names while the problem is lack
! 			 * of premission, only retry if the file already
  			 * exists. */
  			if (errno != EEXIST)
  			    break;
--- 2098,2104 ----
  			fp_out = NULL;
  # ifdef EEXIST
  			/* Avoid trying lots of names while the problem is lack
! 			 * of permission, only retry if the file already
  			 * exists. */
  			if (errno != EEXIST)
  			    break;
***************
*** 5040,5045 ****
--- 5040,5046 ----
  	}
  	subflags.do_error = TRUE;
  	subflags.do_print = FALSE;
+ 	subflags.do_list = FALSE;
  	subflags.do_count = FALSE;
  	subflags.do_number = FALSE;
  	subflags.do_ic = 0;
*** ../vim-8.1.0886/src/testdir/test_substitute.vim	2019-01-09 23:00:58.001176090 +0100
--- src/testdir/test_substitute.vim	2019-02-10 21:52:20.042996065 +0100
***************
*** 107,112 ****
--- 107,138 ----
    endfor
  endfunc
  
+ " Test the l, p, # flags.
+ func Test_substitute_flags_lp()
+   new
+   call setline(1, "abc\tdef\<C-h>ghi")
+ 
+   let a = execute('s/a/a/p')
+   call assert_equal("\nabc     def^Hghi", a)
+ 
+   let a = execute('s/a/a/l')
+   call assert_equal("\nabc^Idef^Hghi$", a)
+ 
+   let a = execute('s/a/a/#')
+   call assert_equal("\n  1 abc     def^Hghi", a)
+ 
+   let a = execute('s/a/a/p#')
+   call assert_equal("\n  1 abc     def^Hghi", a)
+ 
+   let a = execute('s/a/a/l#')
+   call assert_equal("\n  1 abc^Idef^Hghi$", a)
+ 
+   let a = execute('s/a/a/')
+   call assert_equal("", a)
+ 
+   bwipe!
+ endfunc
+ 
  func Test_substitute_repeat()
    " This caused an invalid memory access.
    split Xfile
*** ../vim-8.1.0886/src/version.c	2019-02-10 21:48:21.385272023 +0100
--- src/version.c	2019-02-10 21:55:06.957451666 +0100
***************
*** 785,786 ****
--- 785,788 ----
  {   /* Add new patch number below this line */
+ /**/
+     887,
  /**/

-- 
BEDEVERE: Stand by for attack!!
   [CUT TO enormous army forming up.  Trebuchets, rows of PIKEMEN, siege
   towers, pennants flying, shouts of "Stand by for attack!"  Traditional
   army build-up shots.  The shouts echo across the ranks of the army.
   We see various groups reacting, and stirring themselves in readiness.]
ARTHUR:   Who are they?
BEDEVERE: Oh, just some friends!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///