6424
|
1 Test for user command counts vim: set ft=vim :
|
|
2
|
|
3 STARTTEST
|
6514
|
4 :so small.vim
|
6537
|
5 :lang C
|
6424
|
6 :let g:lines = []
|
6464
|
7 :com -range=% RangeLines :call add(g:lines, 'RangeLines '.<line1>.' '.<line2>)
|
6424
|
8 :com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '.<line1>.' '.<line2>)
|
|
9 :com -range=% -addr=arguments RangeArgumentsAll :call add(g:lines, 'RangeArgumentsAll '.<line1>.' '.<line2>)
|
|
10 :com -range -addr=loaded_buffers RangeLoadedBuffers :call add(g:lines, 'RangeLoadedBuffers '.<line1>.' '.<line2>)
|
|
11 :com -range=% -addr=loaded_buffers RangeLoadedBuffersAll :call add(g:lines, 'RangeLoadedBuffersAll '.<line1>.' '.<line2>)
|
|
12 :com -range -addr=buffers RangeBuffers :call add(g:lines, 'RangeBuffers '.<line1>.' '.<line2>)
|
|
13 :com -range=% -addr=buffers RangeBuffersAll :call add(g:lines, 'RangeBuffersAll '.<line1>.' '.<line2>)
|
|
14 :com -range -addr=windows RangeWindows :call add(g:lines, 'RangeWindows '.<line1>.' '.<line2>)
|
|
15 :com -range=% -addr=windows RangeWindowsAll :call add(g:lines, 'RangeWindowsAll '.<line1>.' '.<line2>)
|
|
16 :com -range -addr=tabs RangeTabs :call add(g:lines, 'RangeTabs '.<line1>.' '.<line2>)
|
|
17 :com -range=% -addr=tabs RangeTabsAll :call add(g:lines, 'RangeTabsAll '.<line1>.' '.<line2>)
|
|
18 :set hidden
|
|
19 :arga a b c d
|
|
20 :argdo echo "loading buffers"
|
|
21 :argu 3
|
|
22 :.-,$-RangeArguments
|
|
23 :%RangeArguments
|
|
24 :RangeArgumentsAll
|
|
25 :N
|
|
26 :.RangeArguments
|
|
27 :split|split|split|split
|
|
28 :3wincmd w
|
|
29 :.,$RangeWindows
|
|
30 :%RangeWindows
|
|
31 :RangeWindowsAll
|
|
32 :only
|
|
33 :blast|bd
|
|
34 :.,$RangeLoadedBuffers
|
|
35 :%RangeLoadedBuffers
|
|
36 :RangeLoadedBuffersAll
|
|
37 :.,$RangeBuffers
|
|
38 :%RangeBuffers
|
|
39 :RangeBuffersAll
|
|
40 :tabe|tabe|tabe|tabe
|
|
41 :normal 2gt
|
|
42 :.,$RangeTabs
|
|
43 :%RangeTabs
|
|
44 :RangeTabsAll
|
|
45 :1tabonly
|
6464
|
46 :s/\n/\r\r\r\r\r/
|
|
47 :2ma<
|
|
48 :$-ma>
|
|
49 :'<,'>RangeLines
|
|
50 :com -range=% -buffer LocalRangeLines :call add(g:lines, 'LocalRangeLines '.<line1>.' '.<line2>)
|
|
51 :'<,'>LocalRangeLines
|
6472
|
52 :b1
|
|
53 ENDTEST
|
|
54
|
|
55 STARTTEST
|
|
56 :call add(g:lines, '')
|
|
57 :%argd
|
|
58 :arga a b c d
|
|
59 :let v:errmsg = ''
|
|
60 :5argu
|
|
61 :call add(g:lines, '5argu ' . v:errmsg)
|
|
62 :$argu
|
|
63 :call add(g:lines, '4argu ' . expand('%:t'))
|
|
64 :let v:errmsg = ''
|
|
65 :1argu
|
|
66 :call add(g:lines, '1argu ' . expand('%:t'))
|
|
67 :let v:errmsg = ''
|
|
68 :100b
|
|
69 :call add(g:lines, '100b ' . v:errmsg)
|
|
70 :split|split|split|split
|
|
71 :let v:errmsg = ''
|
|
72 :0close
|
|
73 :call add(g:lines, '0close ' . v:errmsg)
|
|
74 :$wincmd w
|
|
75 :$close
|
|
76 :call add(g:lines, '$close ' . winnr())
|
|
77 :let v:errmsg = ''
|
|
78 :$+close
|
|
79 :call add(g:lines, '$+close ' . v:errmsg)
|
|
80 :$tabe
|
|
81 :call add(g:lines, '$tabe ' . tabpagenr())
|
|
82 :let v:errmsg = ''
|
|
83 :$+tabe
|
|
84 :call add(g:lines, '$+tabe ' . v:errmsg)
|
|
85 :only!
|
|
86 :e x
|
|
87 :0tabm
|
|
88 :normal 1gt
|
|
89 :call add(g:lines, '0tabm ' . expand('%:t'))
|
|
90 :tabonly!
|
|
91 :only!
|
6424
|
92 :e! test.out
|
|
93 :call append(0, g:lines)
|
6474
|
94 :unlet g:lines
|
|
95 :w|bd
|
|
96 :b1
|
|
97 ENDTEST
|
|
98
|
|
99 STARTTEST
|
6516
|
100 :let g:lines = []
|
|
101 :func BufStatus()
|
|
102 : call add(g:lines, 'aaa: ' . buflisted(g:buf_aaa) . ' bbb: ' . buflisted(g:buf_bbb) . ' ccc: ' . buflisted(g:buf_ccc))
|
|
103 :endfunc
|
|
104 :se nohidden
|
|
105 :e aaa
|
|
106 :let buf_aaa = bufnr('%')
|
|
107 :e bbb
|
|
108 :let buf_bbb = bufnr('%')
|
|
109 :e ccc
|
|
110 :let buf_ccc = bufnr('%')
|
|
111 :b1
|
|
112 :call BufStatus()
|
|
113 :exe buf_bbb . "," . buf_ccc . "bdelete"
|
|
114 :call BufStatus()
|
|
115 :exe buf_aaa . "bdelete"
|
|
116 :call BufStatus()
|
|
117 :e! test.out
|
|
118 :call append('$', g:lines)
|
|
119 :unlet g:lines
|
|
120 :delfunc BufStatus
|
|
121 :w|bd
|
|
122 :b1
|
|
123 ENDTEST
|
|
124
|
|
125 STARTTEST
|
|
126 :se hidden
|
6474
|
127 :only!
|
|
128 :let g:lines = []
|
|
129 :%argd
|
|
130 :arga a b c d e f
|
|
131 :3argu
|
|
132 :let args = ''
|
|
133 :.,$-argdo let args .= ' '.expand('%')
|
|
134 :call add(g:lines, 'argdo:' . args)
|
|
135 :split|split|split|split
|
|
136 :2wincmd w
|
|
137 :let windows = ''
|
|
138 :.,$-windo let windows .= ' '.winnr()
|
|
139 :call add(g:lines, 'windo:'. windows)
|
|
140 :b2
|
|
141 :let buffers = ''
|
|
142 :.,$-bufdo let buffers .= ' '.bufnr('%')
|
|
143 :call add(g:lines, 'bufdo:' . buffers)
|
6641
|
144 :3bd
|
6474
|
145 :let buffers = ''
|
|
146 :3,7bufdo let buffers .= ' '.bufnr('%')
|
|
147 :call add(g:lines, 'bufdo:' . buffers)
|
|
148 :tabe|tabe|tabe|tabe
|
|
149 :normal! 2gt
|
|
150 :let tabpages = ''
|
|
151 :.,$-tabdo let tabpages .= ' '.tabpagenr()
|
|
152 :call add(g:lines, 'tabdo:' . tabpages)
|
|
153 :e! test.out
|
|
154 :call append('$', g:lines)
|
6424
|
155 :w|qa!
|
|
156 ENDTEST
|
|
157
|
|
158
|