annotate src/testdir/test17.in @ 12289:294f510f6d35 v8.0.1024

patch 8.0.1024: folds lost when session file has a buffer in two windows commit https://github.com/vim/vim/commit/4bebc9a0565670b853d227f81a9a31eafdb47eed Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 30 21:07:38 2017 +0200 patch 8.0.1024: folds lost when session file has a buffer in two windows Problem: Manual folds are lost when a session file has the same buffer in two windows. (Jeansen) Solution: Use ":edit" only once. (Christian Brabandt, closes #1958)
author Christian Brabandt <cb@256bit.org>
date Wed, 30 Aug 2017 21:15:04 +0200
parents 05e7d084c6c2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
1 Tests for:
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
2 - "gf" on ${VAR},
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
3 - ":checkpath!" with various 'include' settings.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 STARTTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 :so small.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 :if has("ebcdic")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 : set isfname=@,240-249,/,.,-,_,+,,,$,:,~,{,}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 :else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 : set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 :endif
9254
05e7d084c6c2 commit https://github.com/vim/vim/commit/abc70bbf363dbbe3f2bf714102f55648a512791e
Christian Brabandt <cb@256bit.org>
parents: 7003
diff changeset
12 :"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 :if has("unix")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 :let $CDIR = "."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 /CDIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 :else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 :if has("amiga")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 :let $TDIR = "/testdir"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 :else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 :let $TDIR = "."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 /TDIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 :endif
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
24 :" Dummy writing for making that sure gf doesn't fail even if the current
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
25 :" file is modified. It can be occurred when executing the following command
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
26 :" directly on Windows without fixing the 'fileformat':
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
27 :" > nmake -f Make_dos.mak test17.out
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
28 :w! test.out
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 gf
5118
5569d11ef585 updated for version 7.3.1302
Bram Moolenaar <bram@vim.org>
parents: 4956
diff changeset
30 :set ff=unix
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 :w! test.out
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
32 :brewind
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 ENDTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 ${CDIR}/test17a.in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 $TDIR/test17a.in
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
37
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
38 STARTTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
39 :" check for 'include' without \zs or \ze
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
40 :lang C
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
41 :call delete("./Xbase.a")
9254
05e7d084c6c2 commit https://github.com/vim/vim/commit/abc70bbf363dbbe3f2bf714102f55648a512791e
Christian Brabandt <cb@256bit.org>
parents: 7003
diff changeset
42 :call delete("Xdir1", "rf")
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
43 :!mkdir Xdir1
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
44 :!mkdir "Xdir1/dir2"
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
45 :e! Xdir1/dir2/foo.a
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
46 i#include "bar.a":
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
47 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
48 :e Xdir1/dir2/bar.a
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
49 i#include "baz.a":
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
50 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
51 :e Xdir1/dir2/baz.a
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
52 i#include "foo.a":
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
53 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
54 :e Xbase.a
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
55 :set path=Xdir1/dir2
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
56 i#include <foo.a>:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
57 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
58 :redir! >>test.out
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
59 :checkpath!
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
60 :redir END
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
61 :brewind
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
62 ENDTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
63
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
64 STARTTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
65 :" check for 'include' with \zs and \ze
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
66 :call delete("./Xbase.b")
9254
05e7d084c6c2 commit https://github.com/vim/vim/commit/abc70bbf363dbbe3f2bf714102f55648a512791e
Christian Brabandt <cb@256bit.org>
parents: 7003
diff changeset
67 :call delete("Xdir1", "rf")
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
68 :!mkdir Xdir1
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
69 :!mkdir "Xdir1/dir2"
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
70 :let &include='^\s*%inc\s*/\zs[^/]\+\ze'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
71 :function! DotsToSlashes()
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
72 : return substitute(v:fname, '\.', '/', 'g') . '.b'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
73 :endfunction
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
74 :let &includeexpr='DotsToSlashes()'
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
75 :e! Xdir1/dir2/foo.b
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
76 i%inc /bar/:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
77 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
78 :e Xdir1/dir2/bar.b
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
79 i%inc /baz/:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
80 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
81 :e Xdir1/dir2/baz.b
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
82 i%inc /foo/:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
83 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
84 :e Xbase.b
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
85 :set path=Xdir1/dir2
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
86 i%inc /foo/:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
87 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
88 :redir! >>test.out
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
89 :checkpath!
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
90 :redir END
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
91 :brewind
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
92 ENDTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
93
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
94 STARTTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
95 :" check for 'include' with \zs and no \ze
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
96 :call delete("./Xbase.c")
9254
05e7d084c6c2 commit https://github.com/vim/vim/commit/abc70bbf363dbbe3f2bf714102f55648a512791e
Christian Brabandt <cb@256bit.org>
parents: 7003
diff changeset
97 :call delete("Xdir1", "rf")
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
98 :!mkdir Xdir1
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
99 :!mkdir "Xdir1/dir2"
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
100 :let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
101 :function! StripNewlineChar()
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
102 : if v:fname =~ '\n$'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
103 : return v:fname[:-2]
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
104 : endif
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
105 : return v:fname
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
106 :endfunction
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
107 :let &includeexpr='StripNewlineChar()'
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
108 :e! Xdir1/dir2/foo.c
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
109 i%inc bar.c:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
110 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
111 :e Xdir1/dir2/bar.c
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
112 i%inc baz.c:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
113 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
114 :e Xdir1/dir2/baz.c
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
115 i%inc foo.c:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
116 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
117 :e Xdir1/dir2/FALSE.c
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
118 i%inc foo.c:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
119 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
120 :e Xbase.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
121 :set path=Xdir1/dir2
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
122 i%inc FALSE.c foo.c:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
123 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
124 :redir! >>test.out
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
125 :checkpath!
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
126 :redir END
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
127 :brewind
5118
5569d11ef585 updated for version 7.3.1302
Bram Moolenaar <bram@vim.org>
parents: 4956
diff changeset
128 :" change "\" to "/" for Windows and fix 'fileformat'
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
129 :e test.out
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
130 :%s#\\#/#g
5118
5569d11ef585 updated for version 7.3.1302
Bram Moolenaar <bram@vim.org>
parents: 4956
diff changeset
131 :set ff&
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 3699
diff changeset
132 :w
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
133 :q
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
134 ENDTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
135