Mercurial > vim
annotate src/testdir/test_options.vim @ 32669:448aef880252
normalize line endings
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 26 Jun 2023 09:54:34 +0200 |
parents | f35ea6c38a20 |
children | 695b50472e85 |
rev | line source |
---|---|
32669
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1 " Test for options |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
3 source shared.vim |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
4 source check.vim |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
5 source view_util.vim |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
6 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
7 func Test_whichwrap() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
8 set whichwrap=b,s |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
9 call assert_equal('b,s', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
10 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
11 set whichwrap+=h,l |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
12 call assert_equal('b,s,h,l', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
13 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
14 set whichwrap+=h,l |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
15 call assert_equal('b,s,h,l', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
16 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
17 set whichwrap+=h,l |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
18 call assert_equal('b,s,h,l', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
19 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
20 set whichwrap=h,h |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
21 call assert_equal('h', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
22 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
23 set whichwrap=h,h,h |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
24 call assert_equal('h', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
25 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
26 " For compatibility with Vim 3.0 and before, number values are also |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
27 " supported for 'whichwrap' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
28 set whichwrap=1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
29 call assert_equal('b', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
30 set whichwrap=2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
31 call assert_equal('s', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
32 set whichwrap=4 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
33 call assert_equal('h,l', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
34 set whichwrap=8 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
35 call assert_equal('<,>', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
36 set whichwrap=16 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
37 call assert_equal('[,]', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
38 set whichwrap=31 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
39 call assert_equal('b,s,h,l,<,>,[,]', &whichwrap) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
40 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
41 set whichwrap& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
42 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
43 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
44 func Test_isfname() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
45 " This used to cause Vim to access uninitialized memory. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
46 set isfname= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
47 call assert_equal("~X", expand("~X")) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
48 set isfname& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
49 " Test for setting 'isfname' to an unsupported character |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
50 let save_isfname = &isfname |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
51 call assert_fails('exe $"set isfname+={"\u1234"}"', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
52 call assert_equal(save_isfname, &isfname) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
53 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
54 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
55 " Test for getting the value of 'pastetoggle' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
56 func Test_pastetoggle() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
57 " character with K_SPECIAL byte |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
58 let &pastetoggle = '…' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
59 call assert_equal('…', &pastetoggle) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
60 call assert_equal("\n pastetoggle=…", execute('set pastetoggle?')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
61 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
62 " modified character with K_SPECIAL byte |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
63 let &pastetoggle = '<M-…>' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
64 call assert_equal('<M-…>', &pastetoggle) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
65 call assert_equal("\n pastetoggle=<M-…>", execute('set pastetoggle?')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
66 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
67 " illegal bytes |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
68 let str = ":\x7f:\x80:\x90:\xd0:" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
69 let &pastetoggle = str |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
70 call assert_equal(str, &pastetoggle) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
71 call assert_equal("\n pastetoggle=" .. strtrans(str), execute('set pastetoggle?')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
72 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
73 unlet str |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
74 set pastetoggle& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
75 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
76 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
77 func Test_wildchar() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
78 " Empty 'wildchar' used to access invalid memory. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
79 call assert_fails('set wildchar=', 'E521:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
80 call assert_fails('set wildchar=abc', 'E521:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
81 set wildchar=<Esc> |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
82 let a=execute('set wildchar?') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
83 call assert_equal("\n wildchar=<Esc>", a) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
84 set wildchar=27 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
85 let a=execute('set wildchar?') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
86 call assert_equal("\n wildchar=<Esc>", a) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
87 set wildchar& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
88 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
89 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
90 func Test_wildoptions() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
91 set wildoptions= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
92 set wildoptions+=tagfile |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
93 set wildoptions+=tagfile |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
94 call assert_equal('tagfile', &wildoptions) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
95 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
96 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
97 func Test_options_command() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
98 let caught = 'ok' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
99 try |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
100 options |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
101 catch |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
102 let caught = v:throwpoint . "\n" . v:exception |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
103 endtry |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
104 call assert_equal('ok', caught) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
105 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
106 " Check if the option-window is opened horizontally. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
107 wincmd j |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
108 call assert_notequal('option-window', bufname('')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
109 wincmd k |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
110 call assert_equal('option-window', bufname('')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
111 " close option-window |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
112 close |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
113 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
114 " Open the option-window vertically. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
115 vert options |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
116 " Check if the option-window is opened vertically. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
117 wincmd l |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
118 call assert_notequal('option-window', bufname('')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
119 wincmd h |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
120 call assert_equal('option-window', bufname('')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
121 " close option-window |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
122 close |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
123 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
124 " Open the option-window at the top. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
125 set splitbelow |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
126 topleft options |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
127 call assert_equal(1, winnr()) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
128 close |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
129 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
130 " Open the option-window at the bottom. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
131 set nosplitbelow |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
132 botright options |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
133 call assert_equal(winnr('$'), winnr()) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
134 close |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
135 set splitbelow& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
136 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
137 " Open the option-window in a new tab. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
138 tab options |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
139 " Check if the option-window is opened in a tab. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
140 normal gT |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
141 call assert_notequal('option-window', bufname('')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
142 normal gt |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
143 call assert_equal('option-window', bufname('')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
144 " close option-window |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
145 close |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
146 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
147 " Open the options window browse |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
148 if has('browse') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
149 browse set |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
150 call assert_equal('option-window', bufname('')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
151 close |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
152 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
153 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
154 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
155 func Test_path_keep_commas() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
156 " Test that changing 'path' keeps two commas. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
157 set path=foo,,bar |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
158 set path-=bar |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
159 set path+=bar |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
160 call assert_equal('foo,,bar', &path) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
161 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
162 set path& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
163 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
164 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
165 func Test_path_too_long() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
166 exe 'set path=' .. repeat('x', 10000) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
167 call assert_fails('find x', 'E854:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
168 set path& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
169 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
170 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
171 func Test_signcolumn() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
172 CheckFeature signs |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
173 call assert_equal("auto", &signcolumn) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
174 set signcolumn=yes |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
175 set signcolumn=no |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
176 call assert_fails('set signcolumn=nope') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
177 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
178 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
179 func Test_filetype_valid() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
180 set ft=valid_name |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
181 call assert_equal("valid_name", &filetype) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
182 set ft=valid-name |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
183 call assert_equal("valid-name", &filetype) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
184 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
185 call assert_fails(":set ft=wrong;name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
186 call assert_fails(":set ft=wrong\\\\name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
187 call assert_fails(":set ft=wrong\\|name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
188 call assert_fails(":set ft=wrong/name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
189 call assert_fails(":set ft=wrong\\\nname", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
190 call assert_equal("valid-name", &filetype) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
191 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
192 exe "set ft=trunc\x00name" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
193 call assert_equal("trunc", &filetype) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
194 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
195 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
196 func Test_syntax_valid() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
197 CheckFeature syntax |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
198 set syn=valid_name |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
199 call assert_equal("valid_name", &syntax) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
200 set syn=valid-name |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
201 call assert_equal("valid-name", &syntax) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
202 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
203 call assert_fails(":set syn=wrong;name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
204 call assert_fails(":set syn=wrong\\\\name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
205 call assert_fails(":set syn=wrong\\|name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
206 call assert_fails(":set syn=wrong/name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
207 call assert_fails(":set syn=wrong\\\nname", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
208 call assert_equal("valid-name", &syntax) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
209 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
210 exe "set syn=trunc\x00name" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
211 call assert_equal("trunc", &syntax) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
212 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
213 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
214 func Test_keymap_valid() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
215 CheckFeature keymap |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
216 call assert_fails(":set kmp=valid_name", "E544:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
217 call assert_fails(":set kmp=valid_name", "valid_name") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
218 call assert_fails(":set kmp=valid-name", "E544:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
219 call assert_fails(":set kmp=valid-name", "valid-name") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
220 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
221 call assert_fails(":set kmp=wrong;name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
222 call assert_fails(":set kmp=wrong\\\\name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
223 call assert_fails(":set kmp=wrong\\|name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
224 call assert_fails(":set kmp=wrong/name", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
225 call assert_fails(":set kmp=wrong\\\nname", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
226 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
227 call assert_fails(":set kmp=trunc\x00name", "E544:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
228 call assert_fails(":set kmp=trunc\x00name", "trunc") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
229 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
230 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
231 func Check_dir_option(name) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
232 " Check that it's possible to set the option. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
233 exe 'set ' . a:name . '=/usr/share/dict/words' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
234 call assert_equal('/usr/share/dict/words', eval('&' . a:name)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
235 exe 'set ' . a:name . '=/usr/share/dict/words,/and/there' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
236 call assert_equal('/usr/share/dict/words,/and/there', eval('&' . a:name)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
237 exe 'set ' . a:name . '=/usr/share/dict\ words' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
238 call assert_equal('/usr/share/dict words', eval('&' . a:name)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
239 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
240 " Check rejecting weird characters. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
241 call assert_fails("set " . a:name . "=/not&there", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
242 call assert_fails("set " . a:name . "=/not>there", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
243 call assert_fails("set " . a:name . "=/not.*there", "E474:") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
244 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
245 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
246 func Test_cinkeys() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
247 " This used to cause invalid memory access |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
248 set cindent cinkeys=0 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
249 norm a |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
250 set cindent& cinkeys& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
251 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
252 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
253 func Test_dictionary() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
254 call Check_dir_option('dictionary') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
255 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
256 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
257 func Test_thesaurus() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
258 call Check_dir_option('thesaurus') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
259 endfun |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
260 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
261 func Test_complete() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
262 " Trailing single backslash used to cause invalid memory access. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
263 set complete=s\ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
264 new |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
265 call feedkeys("i\<C-N>\<Esc>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
266 bwipe! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
267 call assert_fails('set complete=ix', 'E535:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
268 set complete& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
269 endfun |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
270 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
271 func Test_set_completion() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
272 call feedkeys(":set di\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
273 call assert_equal('"set dictionary diff diffexpr diffopt digraph directory display', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
274 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
275 call feedkeys(":setlocal di\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
276 call assert_equal('"setlocal dictionary diff diffexpr diffopt digraph directory display', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
277 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
278 call feedkeys(":setglobal di\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
279 call assert_equal('"setglobal dictionary diff diffexpr diffopt digraph directory display', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
280 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
281 " Expand boolean options. When doing :set no<Tab> Vim prefixes the option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
282 " names with "no". |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
283 call feedkeys(":set nodi\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
284 call assert_equal('"set nodiff nodigraph', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
285 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
286 call feedkeys(":set invdi\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
287 call assert_equal('"set invdiff invdigraph', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
288 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
289 " Expanding "set noinv" does nothing. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
290 call feedkeys(":set noinv\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
291 call assert_equal('"set noinv', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
292 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
293 " Expand abbreviation of options. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
294 call feedkeys(":set ts\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
295 call assert_equal('"set tabstop thesaurus thesaurusfunc ttyscroll', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
296 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
297 " Expand current value |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
298 call feedkeys(":set fileencodings=\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
299 call assert_equal('"set fileencodings=ucs-bom,utf-8,default,latin1', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
300 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
301 call feedkeys(":set fileencodings:\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
302 call assert_equal('"set fileencodings:ucs-bom,utf-8,default,latin1', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
303 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
304 " Expand key codes. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
305 call feedkeys(":set <H\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
306 call assert_equal('"set <Help> <Home>', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
307 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
308 " Expand terminal options. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
309 call feedkeys(":set t_A\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
310 call assert_equal('"set t_AB t_AF t_AU t_AL', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
311 call assert_fails('call feedkeys(":set <t_afoo>=\<C-A>\<CR>", "xt")', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
312 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
313 " Expand directories. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
314 call feedkeys(":set cdpath=./\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
315 call assert_match(' ./samples/ ', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
316 call assert_notmatch(' ./summarize.vim ', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
317 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
318 " Expand files and directories. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
319 call feedkeys(":set tags=./\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
320 call assert_match(' ./samples/.* ./summarize.vim', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
321 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
322 call feedkeys(":set tags=./\\\\ dif\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
323 call assert_equal('"set tags=./\\ diff diffexpr diffopt', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
324 set tags& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
325 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
326 " Expanding the option names |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
327 call feedkeys(":set \<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
328 call assert_equal('"set all', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
329 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
330 " Expanding a second set of option names |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
331 call feedkeys(":set wrapscan \<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
332 call assert_equal('"set wrapscan all', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
333 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
334 " Expanding a special keycode |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
335 call feedkeys(":set <Home>\<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
336 call assert_equal('"set <Home>', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
337 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
338 " Expanding an invalid special keycode |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
339 call feedkeys(":set <abcd>\<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
340 call assert_equal("\"set <abcd>\<Tab>", @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
341 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
342 " Expanding a terminal keycode |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
343 call feedkeys(":set t_AB\<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
344 call assert_equal("\"set t_AB", @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
345 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
346 " Expanding an invalid option name |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
347 call feedkeys(":set abcde=\<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
348 call assert_equal("\"set abcde=\<Tab>", @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
349 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
350 " Expanding after a = for a boolean option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
351 call feedkeys(":set wrapscan=\<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
352 call assert_equal("\"set wrapscan=\<Tab>", @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
353 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
354 " Expanding a numeric option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
355 call feedkeys(":set tabstop+=\<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
356 call assert_equal("\"set tabstop+=" .. &tabstop, @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
357 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
358 " Expanding a non-boolean option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
359 call feedkeys(":set invtabstop=\<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
360 call assert_equal("\"set invtabstop=", @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
361 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
362 " Expand options for 'spellsuggest' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
363 call feedkeys(":set spellsuggest=best,file:xyz\<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
364 call assert_equal("\"set spellsuggest=best,file:xyz", @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
365 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
366 " Expand value for 'key' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
367 set key=abcd |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
368 call feedkeys(":set key=\<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
369 call assert_equal('"set key=*****', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
370 set key= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
371 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
372 " Expand values for 'filetype' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
373 call feedkeys(":set filetype=sshdconfi\<Tab>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
374 call assert_equal('"set filetype=sshdconfig', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
375 call feedkeys(":set filetype=a\<C-A>\<C-B>\"\<CR>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
376 call assert_equal('"set filetype=' .. getcompletion('a*', 'filetype')->join(), @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
377 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
378 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
379 func Test_set_option_errors() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
380 call assert_fails('set scroll=-1', 'E49:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
381 call assert_fails('set backupcopy=', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
382 call assert_fails('set regexpengine=3', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
383 call assert_fails('set history=10001', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
384 call assert_fails('set numberwidth=21', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
385 call assert_fails('set colorcolumn=-a', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
386 call assert_fails('set colorcolumn=a', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
387 call assert_fails('set colorcolumn=1,', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
388 call assert_fails('set colorcolumn=1;', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
389 call assert_fails('set cmdheight=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
390 call assert_fails('set cmdwinheight=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
391 if has('conceal') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
392 call assert_fails('set conceallevel=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
393 call assert_fails('set conceallevel=4', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
394 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
395 call assert_fails('set helpheight=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
396 call assert_fails('set history=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
397 call assert_fails('set report=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
398 call assert_fails('set shiftwidth=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
399 call assert_fails('set sidescroll=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
400 call assert_fails('set tabstop=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
401 call assert_fails('set tabstop=10000', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
402 call assert_fails('let &tabstop = 10000', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
403 call assert_fails('set tabstop=5500000000', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
404 call assert_fails('set textwidth=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
405 call assert_fails('set timeoutlen=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
406 call assert_fails('set updatecount=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
407 call assert_fails('set updatetime=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
408 call assert_fails('set winheight=-1', 'E487:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
409 call assert_fails('set tabstop!', 'E488:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
410 call assert_fails('set xxx', 'E518:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
411 call assert_fails('set beautify?', 'E519:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
412 call assert_fails('set undolevels=x', 'E521:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
413 call assert_fails('set tabstop=', 'E521:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
414 call assert_fails('set comments=-', 'E524:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
415 call assert_fails('set comments=a', 'E525:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
416 call assert_fails('set foldmarker=x', 'E536:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
417 call assert_fails('set commentstring=x', 'E537:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
418 call assert_fails('let &commentstring = "x"', 'E537:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
419 call assert_fails('set complete=x', 'E539:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
420 call assert_fails('set rulerformat=%-', 'E539:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
421 call assert_fails('set rulerformat=%(', 'E542:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
422 call assert_fails('set rulerformat=%15(%%', 'E542:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
423 call assert_fails('set statusline=%$', 'E539:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
424 call assert_fails('set statusline=%{', 'E540:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
425 call assert_fails('set statusline=%{%', 'E540:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
426 call assert_fails('set statusline=%{%}', 'E539:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
427 call assert_fails('set statusline=%(', 'E542:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
428 call assert_fails('set statusline=%)', 'E542:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
429 call assert_fails('set tabline=%$', 'E539:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
430 call assert_fails('set tabline=%{', 'E540:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
431 call assert_fails('set tabline=%{%', 'E540:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
432 call assert_fails('set tabline=%{%}', 'E539:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
433 call assert_fails('set tabline=%(', 'E542:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
434 call assert_fails('set tabline=%)', 'E542:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
435 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
436 if has('cursorshape') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
437 " This invalid value for 'guicursor' used to cause Vim to crash. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
438 call assert_fails('set guicursor=i-ci,r-cr:h', 'E545:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
439 call assert_fails('set guicursor=i-ci', 'E545:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
440 call assert_fails('set guicursor=x', 'E545:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
441 call assert_fails('set guicursor=x:', 'E546:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
442 call assert_fails('set guicursor=r-cr:horx', 'E548:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
443 call assert_fails('set guicursor=r-cr:hor0', 'E549:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
444 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
445 if has('mouseshape') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
446 call assert_fails('se mouseshape=i-r:x', 'E547:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
447 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
448 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
449 " Test for 'backupext' and 'patchmode' set to the same value |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
450 set backupext=.bak |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
451 set patchmode=.patch |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
452 call assert_fails('set patchmode=.bak', 'E589:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
453 call assert_equal('.patch', &patchmode) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
454 call assert_fails('set backupext=.patch', 'E589:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
455 call assert_equal('.bak', &backupext) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
456 set backupext& patchmode& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
457 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
458 call assert_fails('set winminheight=10 winheight=9', 'E591:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
459 set winminheight& winheight& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
460 set winheight=10 winminheight=10 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
461 call assert_fails('set winheight=9', 'E591:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
462 set winminheight& winheight& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
463 call assert_fails('set winminwidth=10 winwidth=9', 'E592:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
464 set winminwidth& winwidth& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
465 call assert_fails('set winwidth=9 winminwidth=10', 'E592:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
466 set winwidth& winminwidth& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
467 call assert_fails("set showbreak=\x01", 'E595:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
468 call assert_fails('set t_foo=', 'E846:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
469 call assert_fails('set tabstop??', 'E488:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
470 call assert_fails('set wrapscan!!', 'E488:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
471 call assert_fails('set tabstop&&', 'E488:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
472 call assert_fails('set wrapscan<<', 'E488:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
473 call assert_fails('set wrapscan=1', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
474 call assert_fails('set autoindent@', 'E488:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
475 call assert_fails('set wildchar=<abc>', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
476 call assert_fails('set cmdheight=1a', 'E521:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
477 call assert_fails('set invcmdheight', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
478 if has('python') || has('python3') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
479 call assert_fails('set pyxversion=6', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
480 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
481 call assert_fails("let &tabstop='ab'", ['E521:', 'E521:']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
482 call assert_fails('set spellcapcheck=%\\(', 'E54:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
483 call assert_fails('set sessionoptions=curdir,sesdir', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
484 call assert_fails('set foldmarker={{{,', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
485 call assert_fails('set sessionoptions=sesdir,curdir', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
486 setlocal listchars=trail:· |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
487 call assert_fails('set ambiwidth=double', 'E834:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
488 setlocal listchars=trail:- |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
489 setglobal listchars=trail:· |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
490 call assert_fails('set ambiwidth=double', 'E834:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
491 set listchars& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
492 setlocal fillchars=stl:· |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
493 call assert_fails('set ambiwidth=double', 'E835:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
494 setlocal fillchars=stl:- |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
495 setglobal fillchars=stl:· |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
496 call assert_fails('set ambiwidth=double', 'E835:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
497 set fillchars& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
498 call assert_fails('set fileencoding=latin1,utf-8', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
499 set nomodifiable |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
500 call assert_fails('set fileencoding=latin1', 'E21:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
501 set modifiable& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
502 call assert_fails('set t_#-&', 'E522:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
503 call assert_fails('let &formatoptions = "?"', 'E539:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
504 call assert_fails('call setbufvar("", "&formatoptions", "?")', 'E539:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
505 call assert_fails('call setwinvar(0, "&scrolloff", [])', ['E745:', 'E745:']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
506 call assert_fails('call setwinvar(0, "&list", [])', ['E745:', 'E745:']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
507 call assert_fails('call setwinvar(0, "&listchars", [])', ['E730:', 'E730:']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
508 call assert_fails('call setwinvar(0, "&nosuchoption", 0)', ['E355:', 'E355:']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
509 call assert_fails('call setwinvar(0, "&nosuchoption", "")', ['E355:', 'E355:']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
510 call assert_fails('call setwinvar(0, "&nosuchoption", [])', ['E355:', 'E355:']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
511 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
512 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
513 func Test_set_encoding() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
514 let save_encoding = &encoding |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
515 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
516 set enc=iso8859-1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
517 call assert_equal('latin1', &enc) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
518 set enc=iso8859_1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
519 call assert_equal('latin1', &enc) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
520 set enc=iso-8859-1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
521 call assert_equal('latin1', &enc) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
522 set enc=iso_8859_1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
523 call assert_equal('latin1', &enc) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
524 set enc=iso88591 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
525 call assert_equal('latin1', &enc) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
526 set enc=iso8859 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
527 call assert_equal('latin1', &enc) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
528 set enc=iso-8859 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
529 call assert_equal('latin1', &enc) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
530 set enc=iso_8859 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
531 call assert_equal('latin1', &enc) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
532 call assert_fails('set enc=iso8858', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
533 call assert_equal('latin1', &enc) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
534 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
535 let &encoding = save_encoding |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
536 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
537 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
538 func CheckWasSet(name) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
539 let verb_cm = execute('verbose set ' .. a:name .. '?') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
540 call assert_match('Last set from.*test_options.vim', verb_cm) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
541 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
542 func CheckWasNotSet(name) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
543 let verb_cm = execute('verbose set ' .. a:name .. '?') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
544 call assert_notmatch('Last set from', verb_cm) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
545 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
546 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
547 " Must be executed before other tests that set 'term'. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
548 func Test_000_term_option_verbose() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
549 CheckNotGui |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
550 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
551 call CheckWasNotSet('t_cm') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
552 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
553 let term_save = &term |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
554 set term=ansi |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
555 call CheckWasSet('t_cm') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
556 let &term = term_save |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
557 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
558 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
559 func Test_copy_context() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
560 setlocal list |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
561 call CheckWasSet('list') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
562 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
563 call CheckWasSet('list') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
564 quit |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
565 setlocal nolist |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
566 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
567 set ai |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
568 call CheckWasSet('ai') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
569 set filetype=perl |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
570 call CheckWasSet('filetype') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
571 set fo=tcroq |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
572 call CheckWasSet('fo') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
573 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
574 split Xsomebuf |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
575 call CheckWasSet('ai') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
576 call CheckWasNotSet('filetype') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
577 call CheckWasSet('fo') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
578 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
579 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
580 func Test_set_ttytype() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
581 CheckUnix |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
582 CheckNotGui |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
583 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
584 " Setting 'ttytype' used to cause a double-free when exiting vim and |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
585 " when vim is compiled with -DEXITFREE. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
586 set ttytype=ansi |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
587 call assert_equal('ansi', &ttytype) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
588 call assert_equal(&ttytype, &term) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
589 set ttytype=xterm |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
590 call assert_equal('xterm', &ttytype) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
591 call assert_equal(&ttytype, &term) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
592 try |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
593 set ttytype= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
594 call assert_report('set ttytype= did not fail') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
595 catch /E529/ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
596 endtry |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
597 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
598 " Some systems accept any terminal name and return dumb settings, |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
599 " check for failure of finding the entry and for missing 'cm' entry. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
600 try |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
601 set ttytype=xxx |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
602 call assert_report('set ttytype=xxx did not fail') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
603 catch /E522\|E437/ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
604 endtry |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
605 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
606 set ttytype& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
607 call assert_equal(&ttytype, &term) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
608 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
609 if has('gui') && !has('gui_running') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
610 call assert_fails('set term=gui', 'E531:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
611 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
612 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
613 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
614 func Test_set_all() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
615 set tw=75 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
616 set iskeyword=a-z,A-Z |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
617 set nosplitbelow |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
618 let out = execute('set all') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
619 call assert_match('textwidth=75', out) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
620 call assert_match('iskeyword=a-z,A-Z', out) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
621 call assert_match('nosplitbelow', out) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
622 set tw& iskeyword& splitbelow& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
623 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
624 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
625 func Test_set_one_column() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
626 let out_mult = execute('set all')->split("\n") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
627 let out_one = execute('set! all')->split("\n") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
628 call assert_true(len(out_mult) < len(out_one)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
629 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
630 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
631 func Test_set_values() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
632 " opt_test.vim is generated from ../optiondefs.h using gen_opt_test.vim |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
633 if filereadable('opt_test.vim') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
634 source opt_test.vim |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
635 else |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
636 throw 'Skipped: opt_test.vim does not exist' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
637 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
638 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
639 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
640 func Test_renderoptions() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
641 " Only do this for Windows Vista and later, fails on Windows XP and earlier. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
642 " Doesn't hurt to do this on a non-Windows system. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
643 if windowsversion() !~ '^[345]\.' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
644 set renderoptions=type:directx |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
645 set rop=type:directx |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
646 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
647 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
648 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
649 func ResetIndentexpr() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
650 set indentexpr= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
651 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
652 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
653 func Test_set_indentexpr() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
654 " this was causing usage of freed memory |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
655 set indentexpr=ResetIndentexpr() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
656 new |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
657 call feedkeys("i\<c-f>", 'x') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
658 call assert_equal('', &indentexpr) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
659 bwipe! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
660 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
661 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
662 func Test_backupskip() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
663 " Option 'backupskip' may contain several comma-separated path |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
664 " specifications if one or more of the environment variables TMPDIR, TMP, |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
665 " or TEMP is defined. To simplify testing, convert the string value into a |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
666 " list. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
667 let bsklist = split(&bsk, ',') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
668 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
669 if has("mac") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
670 let found = (index(bsklist, '/private/tmp/*') >= 0) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
671 call assert_true(found, '/private/tmp not in option bsk: ' . &bsk) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
672 elseif has("unix") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
673 let found = (index(bsklist, '/tmp/*') >= 0) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
674 call assert_true(found, '/tmp not in option bsk: ' . &bsk) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
675 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
676 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
677 " If our test platform is Windows, the path(s) in option bsk will use |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
678 " backslash for the path separator and the components could be in short |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
679 " (8.3) format. As such, we need to replace the backslashes with forward |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
680 " slashes and convert the path components to long format. The expand() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
681 " function will do this but it cannot handle comma-separated paths. This is |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
682 " why bsk was converted from a string into a list of strings above. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
683 " |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
684 " One final complication is that the wildcard "/*" is at the end of each |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
685 " path and so expand() might return a list of matching files. To prevent |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
686 " this, we need to remove the wildcard before calling expand() and then |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
687 " append it afterwards. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
688 if has('win32') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
689 let item_nbr = 0 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
690 while item_nbr < len(bsklist) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
691 let path_spec = bsklist[item_nbr] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
692 let path_spec = strcharpart(path_spec, 0, strlen(path_spec)-2) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
693 let path_spec = substitute(expand(path_spec), '\\', '/', 'g') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
694 let bsklist[item_nbr] = path_spec . '/*' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
695 let item_nbr += 1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
696 endwhile |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
697 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
698 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
699 " Option bsk will also include these environment variables if defined. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
700 " If they're defined, verify they appear in the option value. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
701 for var in ['$TMPDIR', '$TMP', '$TEMP'] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
702 if exists(var) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
703 let varvalue = substitute(expand(var), '\\', '/', 'g') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
704 let varvalue = substitute(varvalue, '/$', '', '') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
705 let varvalue .= '/*' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
706 let found = (index(bsklist, varvalue) >= 0) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
707 call assert_true(found, var . ' (' . varvalue . ') not in option bsk: ' . &bsk) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
708 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
709 endfor |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
710 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
711 " Duplicates from environment variables should be filtered out (option has |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
712 " P_NODUP). Run this in a separate instance and write v:errors in a file, |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
713 " so that we see what happens on startup. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
714 let after =<< trim [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
715 let bsklist = split(&backupskip, ',') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
716 call assert_equal(uniq(copy(bsklist)), bsklist) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
717 call writefile(['errors:'] + v:errors, 'Xtestout') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
718 qall |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
719 [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
720 call writefile(after, 'Xafter', 'D') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
721 let cmd = GetVimProg() . ' --not-a-term -S Xafter --cmd "set enc=utf8"' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
722 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
723 let saveenv = {} |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
724 for var in ['TMPDIR', 'TMP', 'TEMP'] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
725 let saveenv[var] = getenv(var) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
726 call setenv(var, '/duplicate/path') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
727 endfor |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
728 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
729 exe 'silent !' . cmd |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
730 call assert_equal(['errors:'], readfile('Xtestout')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
731 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
732 " restore environment variables |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
733 for var in ['TMPDIR', 'TMP', 'TEMP'] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
734 call setenv(var, saveenv[var]) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
735 endfor |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
736 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
737 call delete('Xtestout') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
738 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
739 " Duplicates should be filtered out (option has P_NODUP) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
740 let backupskip = &backupskip |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
741 set backupskip= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
742 set backupskip+=/test/dir |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
743 set backupskip+=/other/dir |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
744 set backupskip+=/test/dir |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
745 call assert_equal('/test/dir,/other/dir', &backupskip) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
746 let &backupskip = backupskip |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
747 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
748 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
749 func Test_buf_copy_winopt() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
750 set hidden |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
751 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
752 " Test copy option from current buffer in window |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
753 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
754 enew |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
755 setlocal numberwidth=5 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
756 wincmd w |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
757 call assert_equal(4,&numberwidth) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
758 bnext |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
759 call assert_equal(5,&numberwidth) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
760 bw! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
761 call assert_equal(4,&numberwidth) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
762 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
763 " Test copy value from window that used to be display the buffer |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
764 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
765 enew |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
766 setlocal numberwidth=6 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
767 bnext |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
768 wincmd w |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
769 call assert_equal(4,&numberwidth) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
770 bnext |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
771 call assert_equal(6,&numberwidth) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
772 bw! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
773 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
774 " Test that if buffer is current, don't use the stale cached value |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
775 " from the last time the buffer was displayed. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
776 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
777 enew |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
778 setlocal numberwidth=7 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
779 bnext |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
780 bnext |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
781 setlocal numberwidth=8 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
782 wincmd w |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
783 call assert_equal(4,&numberwidth) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
784 bnext |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
785 call assert_equal(8,&numberwidth) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
786 bw! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
787 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
788 " Test value is not copied if window already has seen the buffer |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
789 enew |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
790 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
791 setlocal numberwidth=9 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
792 bnext |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
793 setlocal numberwidth=10 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
794 wincmd w |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
795 call assert_equal(4,&numberwidth) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
796 bnext |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
797 call assert_equal(4,&numberwidth) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
798 bw! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
799 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
800 set hidden& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
801 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
802 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
803 def Test_split_copy_options() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
804 var values = [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
805 ['cursorbind', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
806 ['fillchars', '"vert:-"', '"' .. &fillchars .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
807 ['list', true, 0], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
808 ['listchars', '"space:-"', '"' .. &listchars .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
809 ['number', true, 0], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
810 ['relativenumber', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
811 ['scrollbind', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
812 ['smoothscroll', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
813 ['virtualedit', '"block"', '"' .. &virtualedit .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
814 ['wincolor', '"Search"', '"' .. &wincolor .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
815 ['wrap', false, true], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
816 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
817 if has('linebreak') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
818 values += [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
819 ['breakindent', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
820 ['breakindentopt', '"min:5"', '"' .. &breakindentopt .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
821 ['linebreak', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
822 ['numberwidth', 7, 4], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
823 ['showbreak', '"++"', '"' .. &showbreak .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
824 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
825 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
826 if has('rightleft') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
827 values += [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
828 ['rightleft', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
829 ['rightleftcmd', '"search"', '"' .. &rightleftcmd .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
830 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
831 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
832 if has('statusline') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
833 values += [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
834 ['statusline', '"---%f---"', '"' .. &statusline .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
835 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
836 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
837 if has('spell') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
838 values += [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
839 ['spell', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
840 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
841 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
842 if has('syntax') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
843 values += [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
844 ['cursorcolumn', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
845 ['cursorline', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
846 ['cursorlineopt', '"screenline"', '"' .. &cursorlineopt .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
847 ['colorcolumn', '"+1"', '"' .. &colorcolumn .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
848 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
849 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
850 if has('diff') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
851 values += [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
852 ['diff', true, false], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
853 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
854 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
855 if has('conceal') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
856 values += [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
857 ['concealcursor', '"nv"', '"' .. &concealcursor .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
858 ['conceallevel', '3', &conceallevel], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
859 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
860 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
861 if has('terminal') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
862 values += [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
863 ['termwinkey', '"<C-X>"', '"' .. &termwinkey .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
864 ['termwinsize', '"10x20"', '"' .. &termwinsize .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
865 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
866 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
867 if has('folding') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
868 values += [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
869 ['foldcolumn', 5, &foldcolumn], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
870 ['foldenable', false, true], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
871 ['foldexpr', '"2 + 3"', '"' .. &foldexpr .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
872 ['foldignore', '"+="', '"' .. &foldignore .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
873 ['foldlevel', 4, &foldlevel], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
874 ['foldmarker', '">>,<<"', '"' .. &foldmarker .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
875 ['foldmethod', '"marker"', '"' .. &foldmethod .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
876 ['foldminlines', 3, &foldminlines], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
877 ['foldnestmax', 17, &foldnestmax], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
878 ['foldtext', '"closed"', '"' .. &foldtext .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
879 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
880 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
881 if has('signs') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
882 values += [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
883 ['signcolumn', '"number"', '"' .. &signcolumn .. '"'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
884 ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
885 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
886 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
887 # set options to non-default value |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
888 for item in values |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
889 exe $'&l:{item[0]} = {item[1]}' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
890 endfor |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
891 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
892 # check values are set in new window |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
893 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
894 for item in values |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
895 exe $'assert_equal({item[1]}, &{item[0]}, "{item[0]}")' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
896 endfor |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
897 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
898 # restore |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
899 close |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
900 for item in values |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
901 exe $'&l:{item[0]} = {item[2]}' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
902 endfor |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
903 enddef |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
904 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
905 func Test_shortmess_F() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
906 new |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
907 call assert_match('\[No Name\]', execute('file')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
908 set shortmess+=F |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
909 call assert_match('\[No Name\]', execute('file')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
910 call assert_match('^\s*$', execute('file foo')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
911 call assert_match('foo', execute('file')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
912 set shortmess-=F |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
913 call assert_match('bar', execute('file bar')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
914 call assert_match('bar', execute('file')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
915 set shortmess& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
916 bwipe |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
917 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
918 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
919 func Test_shortmess_F2() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
920 e file1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
921 e file2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
922 call assert_match('file1', execute('bn', '')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
923 call assert_match('file2', execute('bn', '')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
924 set shortmess+=F |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
925 call assert_true(empty(execute('bn', ''))) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
926 call assert_false(test_getvalue('need_fileinfo')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
927 call assert_true(empty(execute('bn', ''))) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
928 call assert_false('need_fileinfo'->test_getvalue()) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
929 set hidden |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
930 call assert_true(empty(execute('bn', ''))) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
931 call assert_false(test_getvalue('need_fileinfo')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
932 call assert_true(empty(execute('bn', ''))) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
933 call assert_false(test_getvalue('need_fileinfo')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
934 set nohidden |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
935 call assert_true(empty(execute('bn', ''))) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
936 call assert_false(test_getvalue('need_fileinfo')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
937 call assert_true(empty(execute('bn', ''))) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
938 call assert_false(test_getvalue('need_fileinfo')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
939 set shortmess& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
940 call assert_match('file1', execute('bn', '')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
941 call assert_match('file2', execute('bn', '')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
942 bwipe |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
943 bwipe |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
944 call assert_fails('call test_getvalue("abc")', 'E475:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
945 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
946 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
947 func Test_local_scrolloff() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
948 set so=5 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
949 set siso=7 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
950 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
951 call assert_equal(5, &so) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
952 setlocal so=3 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
953 call assert_equal(3, &so) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
954 wincmd w |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
955 call assert_equal(5, &so) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
956 wincmd w |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
957 setlocal so< |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
958 call assert_equal(5, &so) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
959 setlocal so=0 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
960 call assert_equal(0, &so) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
961 setlocal so=-1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
962 call assert_equal(5, &so) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
963 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
964 call assert_equal(7, &siso) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
965 setlocal siso=3 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
966 call assert_equal(3, &siso) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
967 wincmd w |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
968 call assert_equal(7, &siso) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
969 wincmd w |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
970 setlocal siso< |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
971 call assert_equal(7, &siso) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
972 setlocal siso=0 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
973 call assert_equal(0, &siso) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
974 setlocal siso=-1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
975 call assert_equal(7, &siso) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
976 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
977 close |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
978 set so& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
979 set siso& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
980 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
981 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
982 func Test_writedelay() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
983 CheckFunction reltimefloat |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
984 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
985 new |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
986 call setline(1, 'empty') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
987 redraw |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
988 set writedelay=10 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
989 let start = reltime() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
990 call setline(1, repeat('x', 70)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
991 redraw |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
992 let elapsed = reltimefloat(reltime(start)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
993 set writedelay=0 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
994 " With 'writedelay' set should take at least 30 * 10 msec |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
995 call assert_inrange(30 * 0.01, 999.0, elapsed) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
996 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
997 bwipe! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
998 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
999 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1000 func Test_visualbell() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1001 set belloff= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1002 set visualbell |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1003 call assert_beeps('normal 0h') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1004 set novisualbell |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1005 set belloff=all |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1006 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1007 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1008 " Test for the 'write' option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1009 func Test_write() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1010 new |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1011 call setline(1, ['L1']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1012 set nowrite |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1013 call assert_fails('write Xwrfile', 'E142:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1014 set write |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1015 close! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1016 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1017 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1018 " Test for 'buftype' option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1019 func Test_buftype() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1020 new |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1021 call setline(1, ['L1']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1022 set buftype=nowrite |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1023 call assert_fails('write', 'E382:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1024 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1025 for val in ['', 'nofile', 'nowrite', 'acwrite', 'quickfix', 'help', 'terminal', 'prompt', 'popup'] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1026 exe 'set buftype=' .. val |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1027 call writefile(['something'], 'XBuftype', 'D') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1028 call assert_fails('write XBuftype', 'E13:', 'with buftype=' .. val) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1029 endfor |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1030 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1031 bwipe! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1032 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1033 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1034 " Test for the 'rightleftcmd' option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1035 func Test_rightleftcmd() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1036 CheckFeature rightleft |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1037 set rightleft |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1038 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1039 let g:l = [] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1040 func AddPos() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1041 call add(g:l, screencol()) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1042 return '' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1043 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1044 cmap <expr> <F2> AddPos() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1045 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1046 set rightleftcmd= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1047 call feedkeys("/\<F2>abc\<Right>\<F2>\<Left>\<Left>\<F2>" .. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1048 \ "\<Right>\<F2>\<Esc>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1049 call assert_equal([2, 5, 3, 4], g:l) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1050 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1051 let g:l = [] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1052 set rightleftcmd=search |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1053 call feedkeys("/\<F2>abc\<Left>\<F2>\<Right>\<Right>\<F2>" .. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1054 \ "\<Left>\<F2>\<Esc>", 'xt') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1055 call assert_equal([&co - 1, &co - 4, &co - 2, &co - 3], g:l) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1056 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1057 cunmap <F2> |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1058 unlet g:l |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1059 set rightleftcmd& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1060 set rightleft& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1061 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1062 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1063 " Test for the 'debug' option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1064 func Test_debug_option() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1065 " redraw to avoid matching previous messages |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1066 redraw |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1067 set debug=beep |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1068 exe "normal \<C-c>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1069 call assert_equal('Beep!', Screenline(&lines)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1070 call assert_equal('line 4:', Screenline(&lines - 1)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1071 " also check a line above, with a certain window width the colon is there |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1072 call assert_match('Test_debug_option:$', |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1073 \ Screenline(&lines - 3) .. Screenline(&lines - 2)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1074 set debug& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1075 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1076 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1077 " Test for the default CDPATH option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1078 func Test_opt_default_cdpath() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1079 let after =<< trim [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1080 call assert_equal(',/path/to/dir1,/path/to/dir2', &cdpath) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1081 call writefile(v:errors, 'Xtestout') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1082 qall |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1083 [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1084 if has('unix') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1085 let $CDPATH='/path/to/dir1:/path/to/dir2' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1086 else |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1087 let $CDPATH='/path/to/dir1;/path/to/dir2' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1088 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1089 if RunVim([], after, '') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1090 call assert_equal([], readfile('Xtestout')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1091 call delete('Xtestout') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1092 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1093 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1094 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1095 " Test for setting keycodes using set |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1096 func Test_opt_set_keycode() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1097 call assert_fails('set <t_k1=l', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1098 call assert_fails('set <Home=l', 'E474:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1099 set <t_k9>=abcd |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1100 call assert_equal('abcd', &t_k9) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1101 set <t_k9>& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1102 set <F9>=xyz |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1103 call assert_equal('xyz', &t_k9) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1104 set <t_k9>& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1105 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1106 " should we test all of them? |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1107 set t_Ce=testCe |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1108 set t_Cs=testCs |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1109 set t_Us=testUs |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1110 set t_ds=testds |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1111 set t_Ds=testDs |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1112 call assert_equal('testCe', &t_Ce) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1113 call assert_equal('testCs', &t_Cs) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1114 call assert_equal('testUs', &t_Us) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1115 call assert_equal('testds', &t_ds) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1116 call assert_equal('testDs', &t_Ds) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1117 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1118 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1119 " Test for changing options in a sandbox |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1120 func Test_opt_sandbox() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1121 for opt in ['backupdir', 'cdpath', 'exrc'] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1122 call assert_fails('sandbox set ' .. opt .. '?', 'E48:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1123 call assert_fails('sandbox let &' .. opt .. ' = 1', 'E48:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1124 endfor |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1125 call assert_fails('sandbox let &modelineexpr = 1', 'E48:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1126 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1127 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1128 " Test for setting an option with local value to global value |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1129 func Test_opt_local_to_global() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1130 setglobal equalprg=gprg |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1131 setlocal equalprg=lprg |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1132 call assert_equal('gprg', &g:equalprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1133 call assert_equal('lprg', &l:equalprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1134 call assert_equal('lprg', &equalprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1135 set equalprg< |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1136 call assert_equal('', &l:equalprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1137 call assert_equal('gprg', &equalprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1138 setglobal equalprg=gnewprg |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1139 setlocal equalprg=lnewprg |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1140 setlocal equalprg< |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1141 call assert_equal('gnewprg', &l:equalprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1142 call assert_equal('gnewprg', &equalprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1143 set equalprg& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1144 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1145 " Test for setting the global/local value of a boolean option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1146 setglobal autoread |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1147 setlocal noautoread |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1148 call assert_false(&autoread) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1149 set autoread< |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1150 call assert_true(&autoread) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1151 setglobal noautoread |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1152 setlocal autoread |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1153 setlocal autoread< |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1154 call assert_false(&autoread) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1155 set autoread& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1156 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1157 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1158 func Test_set_in_sandbox() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1159 " Some boolean options cannot be set in sandbox, some can. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1160 call assert_fails('sandbox set modelineexpr', 'E48:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1161 sandbox set number |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1162 call assert_true(&number) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1163 set number& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1164 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1165 " Some boolean options cannot be set in sandbox, some can. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1166 if has('python') || has('python3') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1167 call assert_fails('sandbox set pyxversion=3', 'E48:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1168 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1169 sandbox set tabstop=4 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1170 call assert_equal(4, &tabstop) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1171 set tabstop& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1172 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1173 " Some string options cannot be set in sandbox, some can. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1174 call assert_fails('sandbox set backupdir=/tmp', 'E48:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1175 sandbox set filetype=perl |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1176 call assert_equal('perl', &filetype) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1177 set filetype& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1178 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1179 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1180 " Test for incrementing, decrementing and multiplying a number option value |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1181 func Test_opt_num_op() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1182 set shiftwidth=4 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1183 set sw+=2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1184 call assert_equal(6, &sw) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1185 set sw-=2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1186 call assert_equal(4, &sw) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1187 set sw^=2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1188 call assert_equal(8, &sw) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1189 set shiftwidth& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1190 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1191 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1192 " Test for setting option values using v:false and v:true |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1193 func Test_opt_boolean() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1194 set number& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1195 set number |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1196 call assert_equal(1, &nu) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1197 set nonu |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1198 call assert_equal(0, &nu) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1199 let &nu = v:true |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1200 call assert_equal(1, &nu) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1201 let &nu = v:false |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1202 call assert_equal(0, &nu) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1203 set number& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1204 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1205 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1206 " Test for the 'window' option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1207 func Test_window_opt() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1208 " Needs only one open widow |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1209 %bw! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1210 call setline(1, range(1, 8)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1211 set window=5 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1212 exe "normal \<C-F>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1213 call assert_equal(4, line('w0')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1214 exe "normal \<C-F>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1215 call assert_equal(7, line('w0')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1216 exe "normal \<C-F>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1217 call assert_equal(8, line('w0')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1218 exe "normal \<C-B>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1219 call assert_equal(5, line('w0')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1220 exe "normal \<C-B>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1221 call assert_equal(2, line('w0')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1222 exe "normal \<C-B>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1223 call assert_equal(1, line('w0')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1224 set window=1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1225 exe "normal gg\<C-F>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1226 call assert_equal(2, line('w0')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1227 exe "normal \<C-F>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1228 call assert_equal(3, line('w0')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1229 exe "normal \<C-B>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1230 call assert_equal(2, line('w0')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1231 exe "normal \<C-B>" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1232 call assert_equal(1, line('w0')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1233 enew! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1234 set window& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1235 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1236 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1237 " Test for the 'winminheight' option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1238 func Test_opt_winminheight() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1239 only! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1240 let &winheight = &lines + 4 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1241 call assert_fails('let &winminheight = &lines + 2', 'E36:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1242 call assert_true(&winminheight <= &lines) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1243 set winminheight& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1244 set winheight& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1245 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1246 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1247 func Test_opt_winminheight_term() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1248 CheckRunVimInTerminal |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1249 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1250 " The tabline should be taken into account. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1251 let lines =<< trim END |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1252 set wmh=0 stal=2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1253 below sp | wincmd _ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1254 below sp | wincmd _ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1255 below sp | wincmd _ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1256 below sp |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1257 END |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1258 call writefile(lines, 'Xwinminheight', 'D') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1259 let buf = RunVimInTerminal('-S Xwinminheight', #{rows: 11}) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1260 call term_sendkeys(buf, ":set wmh=1\n") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1261 call WaitForAssert({-> assert_match('E36: Not enough room', term_getline(buf, 11))}) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1262 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1263 call StopVimInTerminal(buf) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1264 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1265 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1266 func Test_opt_winminheight_term_tabs() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1267 CheckRunVimInTerminal |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1268 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1269 " The tabline should be taken into account. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1270 let lines =<< trim END |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1271 set wmh=0 stal=2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1272 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1273 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1274 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1275 split |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1276 tabnew |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1277 END |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1278 call writefile(lines, 'Xwinminheight', 'D') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1279 let buf = RunVimInTerminal('-S Xwinminheight', #{rows: 11}) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1280 call term_sendkeys(buf, ":set wmh=1\n") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1281 call WaitForAssert({-> assert_match('E36: Not enough room', term_getline(buf, 11))}) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1282 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1283 call StopVimInTerminal(buf) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1284 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1285 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1286 " Test for the 'winminwidth' option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1287 func Test_opt_winminwidth() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1288 only! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1289 let &winwidth = &columns + 4 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1290 call assert_fails('let &winminwidth = &columns + 2', 'E36:') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1291 call assert_true(&winminwidth <= &columns) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1292 set winminwidth& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1293 set winwidth& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1294 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1295 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1296 " Test for setting option value containing spaces with isfname+=32 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1297 func Test_isfname_with_options() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1298 set isfname+=32 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1299 setlocal keywordprg=:term\ help.exe |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1300 call assert_equal(':term help.exe', &keywordprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1301 set isfname& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1302 setlocal keywordprg& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1303 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1304 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1305 " Test that resetting laststatus does change scroll option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1306 func Test_opt_reset_scroll() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1307 CheckRunVimInTerminal |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1308 let vimrc =<< trim [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1309 set scroll=2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1310 set laststatus=2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1311 [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1312 call writefile(vimrc, 'Xscroll', 'D') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1313 let buf = RunVimInTerminal('-S Xscroll', {'rows': 16, 'cols': 45}) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1314 call term_sendkeys(buf, ":verbose set scroll?\n") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1315 call WaitForAssert({-> assert_match('Last set.*window size', term_getline(buf, 15))}) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1316 call assert_match('^\s*scroll=7$', term_getline(buf, 14)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1317 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1318 " clean up |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1319 call StopVimInTerminal(buf) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1320 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1321 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1322 " Check that VIM_POSIX env variable influences default value of 'cpo' and 'shm' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1323 func Test_VIM_POSIX() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1324 let saved_VIM_POSIX = getenv("VIM_POSIX") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1325 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1326 call setenv('VIM_POSIX', "1") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1327 let after =<< trim [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1328 call writefile([&cpo, &shm], 'X_VIM_POSIX') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1329 qall |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1330 [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1331 if RunVim([], after, '') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1332 call assert_equal(['aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>#{|&/\.;', |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1333 \ 'AS'], readfile('X_VIM_POSIX')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1334 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1335 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1336 call setenv('VIM_POSIX', v:null) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1337 let after =<< trim [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1338 call writefile([&cpo, &shm], 'X_VIM_POSIX') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1339 qall |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1340 [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1341 if RunVim([], after, '') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1342 call assert_equal(['aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>;', |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1343 \ 'S'], readfile('X_VIM_POSIX')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1344 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1345 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1346 call delete('X_VIM_POSIX') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1347 call setenv('VIM_POSIX', saved_VIM_POSIX) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1348 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1349 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1350 " Test for setting an option to a Vi or Vim default |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1351 func Test_opt_default() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1352 set formatoptions&vi |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1353 call assert_equal('vt', &formatoptions) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1354 set formatoptions&vim |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1355 call assert_equal('tcq', &formatoptions) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1356 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1357 call assert_equal('ucs-bom,utf-8,default,latin1', &fencs) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1358 set fencs=latin1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1359 set fencs& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1360 call assert_equal('ucs-bom,utf-8,default,latin1', &fencs) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1361 set fencs=latin1 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1362 set all& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1363 call assert_equal('ucs-bom,utf-8,default,latin1', &fencs) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1364 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1365 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1366 " Test for the 'cmdheight' option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1367 func Test_cmdheight() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1368 %bw! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1369 let ht = &lines |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1370 set cmdheight=9999 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1371 call assert_equal(1, winheight(0)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1372 call assert_equal(ht - 1, &cmdheight) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1373 set cmdheight& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1374 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1375 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1376 " To specify a control character as an option value, '^' can be used |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1377 func Test_opt_control_char() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1378 set wildchar=^v |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1379 call assert_equal("\<C-V>", nr2char(&wildchar)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1380 set wildcharm=^r |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1381 call assert_equal("\<C-R>", nr2char(&wildcharm)) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1382 " Bug: This doesn't work for the 'cedit' and 'termwinkey' options |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1383 set wildchar& wildcharm& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1384 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1385 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1386 " Test for the 'errorbells' option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1387 func Test_opt_errorbells() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1388 set errorbells |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1389 call assert_beeps('s/a1b2/x1y2/') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1390 set noerrorbells |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1391 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1392 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1393 func Test_opt_scrolljump() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1394 help |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1395 resize 10 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1396 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1397 " Test with positive 'scrolljump'. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1398 set scrolljump=2 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1399 norm! Lj |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1400 call assert_equal({'lnum':11, 'leftcol':0, 'col':0, 'topfill':0, |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1401 \ 'topline':3, 'coladd':0, 'skipcol':0, 'curswant':0}, |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1402 \ winsaveview()) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1403 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1404 " Test with negative 'scrolljump' (percentage of window height). |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1405 set scrolljump=-40 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1406 norm! ggLj |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1407 call assert_equal({'lnum':11, 'leftcol':0, 'col':0, 'topfill':0, |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1408 \ 'topline':5, 'coladd':0, 'skipcol':0, 'curswant':0}, |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1409 \ winsaveview()) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1410 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1411 set scrolljump& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1412 bw |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1413 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1414 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1415 " Test for the 'cdhome' option |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1416 func Test_opt_cdhome() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1417 if has('unix') || has('vms') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1418 throw 'Skipped: only works on non-Unix' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1419 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1420 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1421 set cdhome& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1422 call assert_equal(0, &cdhome) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1423 set cdhome |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1424 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1425 " This paragraph is copied from Test_cd_no_arg(). |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1426 let path = getcwd() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1427 cd |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1428 call assert_equal($HOME, getcwd()) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1429 call assert_notequal(path, getcwd()) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1430 exe 'cd ' .. fnameescape(path) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1431 call assert_equal(path, getcwd()) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1432 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1433 set cdhome& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1434 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1435 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1436 func Test_set_completion_2() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1437 CheckOption termguicolors |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1438 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1439 " Test default option completion |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1440 set wildoptions= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1441 call feedkeys(":set termg\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1442 call assert_equal('"set termguicolors', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1443 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1444 call feedkeys(":set notermg\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1445 call assert_equal('"set notermguicolors', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1446 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1447 " Test fuzzy option completion |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1448 set wildoptions=fuzzy |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1449 call feedkeys(":set termg\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1450 call assert_equal('"set termguicolors termencoding', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1451 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1452 call feedkeys(":set notermg\<C-A>\<C-B>\"\<CR>", 'tx') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1453 call assert_equal('"set notermguicolors', @:) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1454 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1455 set wildoptions= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1456 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1457 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1458 func Test_switchbuf_reset() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1459 set switchbuf=useopen |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1460 sblast |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1461 call assert_equal(1, winnr('$')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1462 set all& |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1463 call assert_equal('', &switchbuf) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1464 sblast |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1465 call assert_equal(2, winnr('$')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1466 only! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1467 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1468 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1469 " :set empty string for global 'keywordprg' falls back to ":help" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1470 func Test_keywordprg_empty() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1471 let k = &keywordprg |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1472 set keywordprg=man |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1473 call assert_equal('man', &keywordprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1474 set keywordprg= |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1475 call assert_equal(':help', &keywordprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1476 set keywordprg=man |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1477 call assert_equal('man', &keywordprg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1478 call assert_equal("\n keywordprg=:help", execute('set kp= kp?')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1479 let &keywordprg = k |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1480 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1481 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1482 " check that the very first buffer created does not have 'endoffile' set |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1483 func Test_endoffile_default() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1484 let after =<< trim [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1485 call writefile([execute('set eof?')], 'Xtestout') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1486 qall! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1487 [CODE] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1488 if RunVim([], after, '') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1489 call assert_equal(["\nnoendoffile"], readfile('Xtestout')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1490 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1491 call delete('Xtestout') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1492 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1493 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1494 " Test for setting the 'lines' and 'columns' options to a minimum value |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1495 func Test_set_min_lines_columns() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1496 let save_lines = &lines |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1497 let save_columns = &columns |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1498 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1499 let after =<< trim END |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1500 set nomore |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1501 let msg = [] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1502 let v:errmsg = '' |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1503 silent! let &columns=0 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1504 call add(msg, v:errmsg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1505 silent! set columns=0 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1506 call add(msg, v:errmsg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1507 silent! call setbufvar('', '&columns', 0) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1508 call add(msg, v:errmsg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1509 "call writefile(msg, 'XResultsetminlines') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1510 silent! let &lines=0 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1511 call add(msg, v:errmsg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1512 silent! set lines=0 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1513 call add(msg, v:errmsg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1514 silent! call setbufvar('', '&lines', 0) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1515 call add(msg, v:errmsg) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1516 call writefile(msg, 'XResultsetminlines') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1517 qall! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1518 END |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1519 if RunVim([], after, '') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1520 call assert_equal(['E594: Need at least 12 columns', |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1521 \ 'E594: Need at least 12 columns: columns=0', |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1522 \ 'E594: Need at least 12 columns', |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1523 \ 'E593: Need at least 2 lines', |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1524 \ 'E593: Need at least 2 lines: lines=0', |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1525 \ 'E593: Need at least 2 lines',], readfile('XResultsetminlines')) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1526 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1527 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1528 call delete('XResultsetminlines') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1529 let &lines = save_lines |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1530 let &columns = save_columns |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1531 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1532 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1533 " Test for reverting a string option value if the new value is invalid. |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1534 func Test_string_option_revert_on_failure() |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1535 new |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1536 let optlist = [ |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1537 \ ['ambiwidth', 'double', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1538 \ ['background', 'dark', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1539 \ ['backspace', 'eol', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1540 \ ['backupcopy', 'no', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1541 \ ['belloff', 'showmatch', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1542 \ ['breakindentopt', 'min:10', 'list'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1543 \ ['bufhidden', 'wipe', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1544 \ ['buftype', 'nowrite', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1545 \ ['casemap', 'keepascii', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1546 \ ['cedit', "\<C-Y>", 'z'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1547 \ ['colorcolumn', '10', 'z'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1548 \ ['commentstring', '#%s', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1549 \ ['complete', '.,t', 'a'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1550 \ ['completefunc', 'MyCmplFunc', '1a-'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1551 \ ['completeopt', 'popup', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1552 \ ['completepopup', 'width:20', 'border'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1553 \ ['concealcursor', 'v', 'xyz'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1554 \ ['cpoptions', 'HJ', '~'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1555 \ ['cryptmethod', 'zip', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1556 \ ['cursorlineopt', 'screenline', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1557 \ ['debug', 'throw', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1558 \ ['diffopt', 'iwhite', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1559 \ ['display', 'uhex', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1560 \ ['eadirection', 'hor', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1561 \ ['encoding', 'utf-8', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1562 \ ['eventignore', 'TextYankPost', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1563 \ ['fileencoding', 'utf-8', 'a123,'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1564 \ ['fileformat', 'mac', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1565 \ ['fileformats', 'mac', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1566 \ ['filetype', 'abc', 'a^b'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1567 \ ['fillchars', 'diff:~', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1568 \ ['foldclose', 'all', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1569 \ ['foldmarker', '[[[,]]]', '[[['], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1570 \ ['foldmethod', 'marker', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1571 \ ['foldopen', 'percent', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1572 \ ['formatoptions', 'an', '*'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1573 \ ['guicursor', 'n-v-c:block-Cursor/lCursor', 'n-v-c'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1574 \ ['helplang', 'en', 'a'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1575 \ ['highlight', '!:CursorColumn', '8:'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1576 \ ['keymodel', 'stopsel', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1577 \ ['keyprotocol', 'kitty:kitty', 'kitty:'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1578 \ ['lispoptions', 'expr:1', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1579 \ ['listchars', 'tab:->', 'tab:'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1580 \ ['matchpairs', '<:>', '<:'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1581 \ ['mkspellmem', '100000,1000,100', '100000'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1582 \ ['mouse', 'nvi', 'z'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1583 \ ['mousemodel', 'extend', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1584 \ ['nrformats', 'alpha', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1585 \ ['omnifunc', 'MyOmniFunc', '1a-'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1586 \ ['operatorfunc', 'MyOpFunc', '1a-'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1587 \ ['previewpopup', 'width:20', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1588 \ ['printoptions', 'paper:A4', 'a123:'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1589 \ ['quickfixtextfunc', 'MyQfFunc', '1a-'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1590 \ ['rulerformat', '%l', '%['], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1591 \ ['scrollopt', 'hor,jump', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1592 \ ['selection', 'exclusive', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1593 \ ['selectmode', 'cmd', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1594 \ ['sessionoptions', 'options', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1595 \ ['shortmess', 'w', '2'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1596 \ ['showbreak', '>>', "\x01"], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1597 \ ['showcmdloc', 'statusline', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1598 \ ['signcolumn', 'no', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1599 \ ['spellcapcheck', '[.?!]\+', '%\{'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1600 \ ['spellfile', 'MySpell.en.add', "\x01"], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1601 \ ['spelllang', 'en', "#"], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1602 \ ['spelloptions', 'camel', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1603 \ ['spellsuggest', 'double', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1604 \ ['splitkeep', 'topline', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1605 \ ['statusline', '%f', '%['], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1606 \ ['swapsync', 'sync', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1607 \ ['switchbuf', 'usetab', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1608 \ ['syntax', 'abc', 'a^b'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1609 \ ['tabline', '%f', '%['], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1610 \ ['tagcase', 'ignore', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1611 \ ['tagfunc', 'MyTagFunc', '1a-'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1612 \ ['thesaurusfunc', 'MyThesaurusFunc', '1a-'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1613 \ ['viewoptions', 'options', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1614 \ ['virtualedit', 'onemore', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1615 \ ['whichwrap', '<,>', '{,}'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1616 \ ['wildmode', 'list', 'a123'], |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1617 \ ['wildoptions', 'pum', 'a123'] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1618 \ ] |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1619 if has('gui') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1620 call add(optlist, ['browsedir', 'buffer', 'a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1621 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1622 if has('clipboard_working') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1623 call add(optlist, ['clipboard', 'unnamed', 'a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1624 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1625 if has('win32') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1626 call add(optlist, ['completeslash', 'slash', 'a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1627 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1628 if has('cscope') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1629 call add(optlist, ['cscopequickfix', 't-', 'z-']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1630 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1631 if !has('win32') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1632 call add(optlist, ['imactivatefunc', 'MyActFunc', '1a-']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1633 call add(optlist, ['imstatusfunc', 'MyStatusFunc', '1a-']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1634 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1635 if has('keymap') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1636 call add(optlist, ['keymap', 'greek', '[]']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1637 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1638 if has('mouseshape') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1639 call add(optlist, ['mouseshape', 'm:no', 'a123:']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1640 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1641 if has('win32') && has('gui') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1642 call add(optlist, ['renderoptions', 'type:directx', 'type:directx,a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1643 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1644 if has('rightleft') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1645 call add(optlist, ['rightleftcmd', 'search', 'a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1646 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1647 if has('terminal') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1648 call add(optlist, ['termwinkey', '<C-L>', '<C']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1649 call add(optlist, ['termwinsize', '24x80', '100']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1650 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1651 if has('win32') && has('terminal') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1652 call add(optlist, ['termwintype', 'winpty', 'a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1653 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1654 if exists('+toolbar') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1655 call add(optlist, ['toolbar', 'text', 'a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1656 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1657 if exists('+toolbariconsize') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1658 call add(optlist, ['toolbariconsize', 'medium', 'a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1659 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1660 if exists('+ttymouse') && !has('gui') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1661 call add(optlist, ['ttymouse', 'xterm', 'a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1662 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1663 if exists('+vartabs') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1664 call add(optlist, ['varsofttabstop', '12', 'a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1665 call add(optlist, ['vartabstop', '4,20', '4,']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1666 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1667 if exists('+winaltkeys') |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1668 call add(optlist, ['winaltkeys', 'no', 'a123']) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1669 endif |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1670 for opt in optlist |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1671 exe $"let save_opt = &{opt[0]}" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1672 try |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1673 exe $"let &{opt[0]} = '{opt[1]}'" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1674 catch |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1675 call assert_report($"Caught {v:exception} with {opt->string()}") |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1676 endtry |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1677 call assert_fails($"let &{opt[0]} = '{opt[2]}'", '', opt[0]) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1678 call assert_equal(opt[1], eval($"&{opt[0]}"), opt[0]) |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1679 exe $"let &{opt[0]} = save_opt" |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1680 endfor |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1681 bw! |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1682 endfunc |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1683 |
448aef880252
normalize line endings
Christian Brabandt <cb@256bit.org>
parents:
32599
diff
changeset
|
1684 " vim: shiftwidth=2 sts=2 expandtab |