]>
Commit | Line | Data |
---|---|---|
46534d20 AM |
1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.609 | |
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.609 | |
11 | Problem: File names in :checkpath! output are garbled. | |
12 | Solution: Check for \zs in the pattern. (Lech Lorens) | |
13 | Files: src/search.c, src/testdir/test17.in, src/testdir/test17.ok | |
14 | ||
15 | ||
16 | *** ../vim-7.3.608/src/search.c 2012-07-19 17:18:21.000000000 +0200 | |
17 | --- src/search.c 2012-07-25 13:33:08.000000000 +0200 | |
18 | *************** | |
19 | *** 4740,4756 **** | |
20 | * Isolate the file name. | |
21 | * Include the surrounding "" or <> if present. | |
22 | */ | |
23 | ! for (p = incl_regmatch.endp[0]; !vim_isfilec(*p); p++) | |
24 | ! ; | |
25 | ! for (i = 0; vim_isfilec(p[i]); i++) | |
26 | ! ; | |
27 | if (i == 0) | |
28 | { | |
29 | /* Nothing found, use the rest of the line. */ | |
30 | p = incl_regmatch.endp[0]; | |
31 | i = (int)STRLEN(p); | |
32 | } | |
33 | ! else | |
34 | { | |
35 | if (p[-1] == '"' || p[-1] == '<') | |
36 | { | |
37 | --- 4740,4772 ---- | |
38 | * Isolate the file name. | |
39 | * Include the surrounding "" or <> if present. | |
40 | */ | |
41 | ! if (inc_opt != NULL | |
42 | ! && strstr((char *)inc_opt, "\\zs") != NULL) | |
43 | ! { | |
44 | ! /* pattern contains \zs, use the match */ | |
45 | ! p = incl_regmatch.startp[0]; | |
46 | ! i = (int)(incl_regmatch.endp[0] | |
47 | ! - incl_regmatch.startp[0]); | |
48 | ! } | |
49 | ! else | |
50 | ! { | |
51 | ! /* find the file name after the end of the match */ | |
52 | ! for (p = incl_regmatch.endp[0]; | |
53 | ! *p && !vim_isfilec(*p); p++) | |
54 | ! ; | |
55 | ! for (i = 0; vim_isfilec(p[i]); i++) | |
56 | ! ; | |
57 | ! } | |
58 | ! | |
59 | if (i == 0) | |
60 | { | |
61 | /* Nothing found, use the rest of the line. */ | |
62 | p = incl_regmatch.endp[0]; | |
63 | i = (int)STRLEN(p); | |
64 | } | |
65 | ! /* Avoid checking before the start of the line, can | |
66 | ! * happen if \zs appears in the regexp. */ | |
67 | ! else if (p > line) | |
68 | { | |
69 | if (p[-1] == '"' || p[-1] == '<') | |
70 | { | |
71 | *** ../vim-7.3.608/src/testdir/test17.in 2010-08-15 21:57:29.000000000 +0200 | |
72 | --- src/testdir/test17.in 2012-07-25 13:41:43.000000000 +0200 | |
73 | *************** | |
74 | *** 1,4 **** | |
75 | ! Tests for "gf" on ${VAR} | |
76 | ||
77 | STARTTEST | |
78 | :so small.vim | |
79 | --- 1,6 ---- | |
80 | ! Tests for: | |
81 | ! - "gf" on ${VAR}, | |
82 | ! - ":checkpath!" with various 'include' settings. | |
83 | ||
84 | STARTTEST | |
85 | :so small.vim | |
86 | *************** | |
87 | *** 20,27 **** | |
88 | :endif | |
89 | gf | |
90 | :w! test.out | |
91 | ! :qa! | |
92 | ENDTEST | |
93 | ||
94 | ${CDIR}/test17a.in | |
95 | $TDIR/test17a.in | |
96 | --- 22,120 ---- | |
97 | :endif | |
98 | gf | |
99 | :w! test.out | |
100 | ! :brewind | |
101 | ENDTEST | |
102 | ||
103 | ${CDIR}/test17a.in | |
104 | $TDIR/test17a.in | |
105 | + | |
106 | + STARTTEST | |
107 | + :" check for 'include' without \zs or \ze | |
108 | + :lang C | |
109 | + :!rm -f ./Xbase.a | |
110 | + :!rm -rf ./Xdir1 | |
111 | + :!mkdir -p Xdir1/dir2 | |
112 | + :e Xdir1/dir2/foo.a | |
113 | + i#include "bar.a"\e | |
114 | + :w | |
115 | + :e Xdir1/dir2/bar.a | |
116 | + i#include "baz.a"\e | |
117 | + :w | |
118 | + :e Xdir1/dir2/baz.a | |
119 | + i#include "foo.a"\e | |
120 | + :w | |
121 | + :e Xbase.a | |
122 | + :set path=Xdir1/dir2 | |
123 | + i#include <foo.a>\e | |
124 | + :w | |
125 | + :redir! >>test.out | |
126 | + :checkpath! | |
127 | + :redir END | |
128 | + :brewind | |
129 | + ENDTEST | |
130 | + | |
131 | + STARTTEST | |
132 | + :" check for 'include' with \zs and \ze | |
133 | + :!rm -f ./Xbase.b | |
134 | + :!rm -rf ./Xdir1 | |
135 | + :!mkdir -p Xdir1/dir2 | |
136 | + :let &include='^\s*%inc\s*/\zs[^/]\+\ze' | |
137 | + :function! DotsToSlashes() | |
138 | + : return substitute(v:fname, '\.', '/', 'g') . '.b' | |
139 | + :endfunction | |
140 | + :let &includeexpr='DotsToSlashes()' | |
141 | + :e Xdir1/dir2/foo.b | |
142 | + i%inc /bar/\e | |
143 | + :w | |
144 | + :e Xdir1/dir2/bar.b | |
145 | + i%inc /baz/\e | |
146 | + :w | |
147 | + :e Xdir1/dir2/baz.b | |
148 | + i%inc /foo/\e | |
149 | + :w | |
150 | + :e Xbase.b | |
151 | + :set path=Xdir1/dir2 | |
152 | + i%inc /foo/\e | |
153 | + :w | |
154 | + :redir! >>test.out | |
155 | + :checkpath! | |
156 | + :redir END | |
157 | + :brewind | |
158 | + ENDTEST | |
159 | + | |
160 | + STARTTEST | |
161 | + :" check for 'include' with \zs and no \ze | |
162 | + :!rm -f ./Xbase.c | |
163 | + :!rm -rf ./Xdir1 | |
164 | + :!mkdir -p Xdir1/dir2 | |
165 | + :let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze' | |
166 | + :function! StripNewlineChar() | |
167 | + : if v:fname =~ '\n$' | |
168 | + : return v:fname[:-2] | |
169 | + : endif | |
170 | + : return v:fname | |
171 | + :endfunction | |
172 | + :let &includeexpr='StripNewlineChar()' | |
173 | + :e Xdir1/dir2/foo.c | |
174 | + i%inc bar.c\e | |
175 | + :w | |
176 | + :e Xdir1/dir2/bar.c | |
177 | + i%inc baz.c\e | |
178 | + :w | |
179 | + :e Xdir1/dir2/baz.c | |
180 | + i%inc foo.c\e | |
181 | + :w | |
182 | + :e Xdir1/dir2/FALSE.c | |
183 | + i%inc foo.c\e | |
184 | + :w | |
185 | + :e Xbase.c | |
186 | + :set path=Xdir1/dir2 | |
187 | + i%inc FALSE.c foo.c\e | |
188 | + :w | |
189 | + :redir! >>test.out | |
190 | + :checkpath! | |
191 | + :redir END | |
192 | + :brewind | |
193 | + :q | |
194 | + ENDTEST | |
195 | + | |
196 | *** ../vim-7.3.608/src/testdir/test17.ok 2010-08-15 21:57:29.000000000 +0200 | |
197 | --- src/testdir/test17.ok 2012-07-25 13:45:37.000000000 +0200 | |
198 | *************** | |
199 | *** 1,3 **** | |
200 | --- 1,33 ---- | |
201 | This file is just to test "gf" in test 17. | |
202 | The contents is not important. | |
203 | Just testing! | |
204 | + | |
205 | + | |
206 | + --- Included files in path --- | |
207 | + Xdir1/dir2/foo.a | |
208 | + Xdir1/dir2/foo.a --> | |
209 | + Xdir1/dir2/bar.a | |
210 | + Xdir1/dir2/bar.a --> | |
211 | + Xdir1/dir2/baz.a | |
212 | + Xdir1/dir2/baz.a --> | |
213 | + "foo.a" (Already listed) | |
214 | + | |
215 | + | |
216 | + --- Included files in path --- | |
217 | + Xdir1/dir2/foo.b | |
218 | + Xdir1/dir2/foo.b --> | |
219 | + Xdir1/dir2/bar.b | |
220 | + Xdir1/dir2/bar.b --> | |
221 | + Xdir1/dir2/baz.b | |
222 | + Xdir1/dir2/baz.b --> | |
223 | + foo (Already listed) | |
224 | + | |
225 | + | |
226 | + --- Included files in path --- | |
227 | + Xdir1/dir2/foo.c | |
228 | + Xdir1/dir2/foo.c --> | |
229 | + Xdir1/dir2/bar.c | |
230 | + Xdir1/dir2/bar.c --> | |
231 | + Xdir1/dir2/baz.c | |
232 | + Xdir1/dir2/baz.c --> | |
233 | + foo.c^@ (Already listed) | |
234 | *** ../vim-7.3.608/src/version.c 2012-07-19 18:05:40.000000000 +0200 | |
235 | --- src/version.c 2012-07-25 13:38:54.000000000 +0200 | |
236 | *************** | |
237 | *** 716,717 **** | |
238 | --- 716,719 ---- | |
239 | { /* Add new patch number below this line */ | |
240 | + /**/ | |
241 | + 609, | |
242 | /**/ | |
243 | ||
244 | -- | |
245 | "The question of whether computers can think is just like the question | |
246 | of whether submarines can swim." -- Edsger W. Dijkstra | |
247 | ||
248 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
249 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
250 | \\\ an exciting new programming language -- http://www.Zimbu.org /// | |
251 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |