summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0274
blob: d63003f4dee1a43337c18b0a97dd50725b90bb4b (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0274
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.0274
Problem:    'incsearch' triggers on ":source".
Solution:   Check for the whole command name.
Files:	    src/ex_getln.c, src/testdir/test_search.vim


*** ../vim-8.1.0273/src/ex_getln.c	2018-08-11 19:02:18.038566056 +0200
--- src/ex_getln.c	2018-08-11 19:08:55.639612407 +0200
***************
*** 293,299 ****
  		// Skip over "substitute" to find the pattern separator.
  		for (p = cmd; ASCII_ISALPHA(*p); ++p)
  		    ;
! 		if (*p != NUL)
  		{
  		    delim = *p++;
  		    end = skip_regexp(p, delim, p_magic, NULL);
--- 293,302 ----
  		// Skip over "substitute" to find the pattern separator.
  		for (p = cmd; ASCII_ISALPHA(*p); ++p)
  		    ;
! 		if (*p != NUL
! 			&& (STRNCMP(cmd, "substitute", p - cmd) == 0
! 			    || STRNCMP(cmd, "global", p - cmd) == 0
! 			    || STRNCMP(cmd, "vglobal", p - cmd) == 0))
  		{
  		    delim = *p++;
  		    end = skip_regexp(p, delim, p_magic, NULL);
*** ../vim-8.1.0273/src/testdir/test_search.vim	2018-08-11 16:40:39.068311966 +0200
--- src/testdir/test_search.vim	2018-08-11 19:11:57.066276471 +0200
***************
*** 342,367 ****
    bw!
  endfunc
  
- func Test_search_cmdline3()
-   if !exists('+incsearch')
-     return
-   endif
-   " need to disable char_avail,
-   " so that expansion of commandline works
-   call test_override("char_avail", 1)
-   new
-   call setline(1, ['  1', '  2 the~e', '  3 the theother'])
-   set incsearch
-   1
-   " first match
-   call feedkeys("/the\<c-l>\<cr>", 'tx')
-   call assert_equal('  2 the~e', getline('.'))
-   " clean up
-   set noincsearch
-   call test_override("char_avail", 0)
-   bw!
- endfunc
- 
  func Cmdline3_prep()
    " need to disable char_avail,
    " so that expansion of commandline works
--- 342,347 ----
***************
*** 377,382 ****
--- 357,375 ----
    bw!
  endfunc
  
+ func Test_search_cmdline3()
+   if !exists('+incsearch')
+     return
+   endif
+   call Cmdline3_prep()
+   1
+   " first match
+   call feedkeys("/the\<c-l>\<cr>", 'tx')
+   call assert_equal('  2 the~e', getline('.'))
+ 
+   call Cmdline3_cleanup()
+ endfunc
+ 
  func Test_search_cmdline3s()
    if !exists('+incsearch')
      return
***************
*** 385,390 ****
--- 378,389 ----
    1
    call feedkeys(":%s/the\<c-l>/xxx\<cr>", 'tx')
    call assert_equal('  2 xxxe', getline('.'))
+   undo
+   call feedkeys(":%subs/the\<c-l>/xxx\<cr>", 'tx')
+   call assert_equal('  2 xxxe', getline('.'))
+   undo
+   call feedkeys(":%substitute/the\<c-l>/xxx\<cr>", 'tx')
+   call assert_equal('  2 xxxe', getline('.'))
  
    call Cmdline3_cleanup()
  endfunc
***************
*** 397,402 ****
--- 396,404 ----
    1
    call feedkeys(":g/the\<c-l>/d\<cr>", 'tx')
    call assert_equal('  3 the theother', getline(2))
+   undo
+   call feedkeys(":global/the\<c-l>/d\<cr>", 'tx')
+   call assert_equal('  3 the theother', getline(2))
  
    call Cmdline3_cleanup()
  endfunc
***************
*** 410,415 ****
--- 412,421 ----
    call feedkeys(":v/the\<c-l>/d\<cr>", 'tx')
    call assert_equal(1, line('$'))
    call assert_equal('  2 the~e', getline(1))
+   undo
+   call feedkeys(":vglobal/the\<c-l>/d\<cr>", 'tx')
+   call assert_equal(1, line('$'))
+   call assert_equal('  2 the~e', getline(1))
  
    call Cmdline3_cleanup()
  endfunc
***************
*** 518,524 ****
    " so that expansion of commandline works
    call test_override("char_avail", 1)
    new
!   let @/='b'
    call setline(1, [' bbvimb', ''])
    set incsearch
    " first match
--- 524,530 ----
    " so that expansion of commandline works
    call test_override("char_avail", 1)
    new
!   let @/ = 'b'
    call setline(1, [' bbvimb', ''])
    set incsearch
    " first match
*** ../vim-8.1.0273/src/version.c	2018-08-11 19:02:18.038566056 +0200
--- src/version.c	2018-08-11 19:11:29.546478790 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     274,
  /**/

-- 
You can be stopped by the police for biking over 65 miles per hour.
You are not allowed to walk across a street on your hands.
		[real standing laws in Connecticut, United States of America]

 /// 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    ///