Mercurial > vim
comparison src/testdir/test17.in @ 3699:d29aa05b7e31 v7.3.609
updated for version 7.3.609
Problem: File names in :checkpath! output are garbled.
Solution: Check for \zs in the pattern. (Lech Lorens)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 25 Jul 2012 13:46:30 +0200 |
parents | 3fc0f57ecb91 |
children | 5cd32322154c |
comparison
equal
deleted
inserted
replaced
3698:580391c2f925 | 3699:d29aa05b7e31 |
---|---|
1 Tests for "gf" on ${VAR} | 1 Tests for: |
2 - "gf" on ${VAR}, | |
3 - ":checkpath!" with various 'include' settings. | |
2 | 4 |
3 STARTTEST | 5 STARTTEST |
4 :so small.vim | 6 :so small.vim |
5 :if has("ebcdic") | 7 :if has("ebcdic") |
6 : set isfname=@,240-249,/,.,-,_,+,,,$,:,~,{,} | 8 : set isfname=@,240-249,/,.,-,_,+,,,$,:,~,{,} |
18 :endif | 20 :endif |
19 /TDIR | 21 /TDIR |
20 :endif | 22 :endif |
21 gf | 23 gf |
22 :w! test.out | 24 :w! test.out |
23 :qa! | 25 :brewind |
24 ENDTEST | 26 ENDTEST |
25 | 27 |
26 ${CDIR}/test17a.in | 28 ${CDIR}/test17a.in |
27 $TDIR/test17a.in | 29 $TDIR/test17a.in |
30 | |
31 STARTTEST | |
32 :" check for 'include' without \zs or \ze | |
33 :lang C | |
34 :!rm -f ./Xbase.a | |
35 :!rm -rf ./Xdir1 | |
36 :!mkdir -p Xdir1/dir2 | |
37 :e Xdir1/dir2/foo.a | |
38 i#include "bar.a" | |
39 :w | |
40 :e Xdir1/dir2/bar.a | |
41 i#include "baz.a" | |
42 :w | |
43 :e Xdir1/dir2/baz.a | |
44 i#include "foo.a" | |
45 :w | |
46 :e Xbase.a | |
47 :set path=Xdir1/dir2 | |
48 i#include <foo.a> | |
49 :w | |
50 :redir! >>test.out | |
51 :checkpath! | |
52 :redir END | |
53 :brewind | |
54 ENDTEST | |
55 | |
56 STARTTEST | |
57 :" check for 'include' with \zs and \ze | |
58 :!rm -f ./Xbase.b | |
59 :!rm -rf ./Xdir1 | |
60 :!mkdir -p Xdir1/dir2 | |
61 :let &include='^\s*%inc\s*/\zs[^/]\+\ze' | |
62 :function! DotsToSlashes() | |
63 : return substitute(v:fname, '\.', '/', 'g') . '.b' | |
64 :endfunction | |
65 :let &includeexpr='DotsToSlashes()' | |
66 :e Xdir1/dir2/foo.b | |
67 i%inc /bar/ | |
68 :w | |
69 :e Xdir1/dir2/bar.b | |
70 i%inc /baz/ | |
71 :w | |
72 :e Xdir1/dir2/baz.b | |
73 i%inc /foo/ | |
74 :w | |
75 :e Xbase.b | |
76 :set path=Xdir1/dir2 | |
77 i%inc /foo/ | |
78 :w | |
79 :redir! >>test.out | |
80 :checkpath! | |
81 :redir END | |
82 :brewind | |
83 ENDTEST | |
84 | |
85 STARTTEST | |
86 :" check for 'include' with \zs and no \ze | |
87 :!rm -f ./Xbase.c | |
88 :!rm -rf ./Xdir1 | |
89 :!mkdir -p Xdir1/dir2 | |
90 :let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze' | |
91 :function! StripNewlineChar() | |
92 : if v:fname =~ '\n$' | |
93 : return v:fname[:-2] | |
94 : endif | |
95 : return v:fname | |
96 :endfunction | |
97 :let &includeexpr='StripNewlineChar()' | |
98 :e Xdir1/dir2/foo.c | |
99 i%inc bar.c | |
100 :w | |
101 :e Xdir1/dir2/bar.c | |
102 i%inc baz.c | |
103 :w | |
104 :e Xdir1/dir2/baz.c | |
105 i%inc foo.c | |
106 :w | |
107 :e Xdir1/dir2/FALSE.c | |
108 i%inc foo.c | |
109 :w | |
110 :e Xbase.c | |
111 :set path=Xdir1/dir2 | |
112 i%inc FALSE.c foo.c | |
113 :w | |
114 :redir! >>test.out | |
115 :checkpath! | |
116 :redir END | |
117 :brewind | |
118 :q | |
119 ENDTEST | |
120 |