summaryrefslogtreecommitdiff
path: root/src/testdir/test_command_count.in
blob: bfde053a8b079414478ed9c2800e11b735c23e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
Test for user command counts	    vim: set ft=vim :

STARTTEST
:so small.vim
:lang C
:let g:lines = []
:com -range=% RangeLines :call add(g:lines, 'RangeLines '.<line1>.' '.<line2>)
:com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '.<line1>.' '.<line2>)
:com -range=% -addr=arguments RangeArgumentsAll :call add(g:lines, 'RangeArgumentsAll '.<line1>.' '.<line2>)
:com -range -addr=loaded_buffers RangeLoadedBuffers :call add(g:lines, 'RangeLoadedBuffers '.<line1>.' '.<line2>)
:com -range=% -addr=loaded_buffers RangeLoadedBuffersAll :call add(g:lines, 'RangeLoadedBuffersAll '.<line1>.' '.<line2>)
:com -range -addr=buffers RangeBuffers :call add(g:lines, 'RangeBuffers '.<line1>.' '.<line2>)
:com -range=% -addr=buffers RangeBuffersAll :call add(g:lines, 'RangeBuffersAll '.<line1>.' '.<line2>)
:com -range -addr=windows RangeWindows :call add(g:lines, 'RangeWindows '.<line1>.' '.<line2>)
:com -range=% -addr=windows RangeWindowsAll :call add(g:lines, 'RangeWindowsAll '.<line1>.' '.<line2>)
:com -range -addr=tabs RangeTabs :call add(g:lines, 'RangeTabs '.<line1>.' '.<line2>)
:com -range=% -addr=tabs RangeTabsAll :call add(g:lines, 'RangeTabsAll '.<line1>.' '.<line2>)
:set hidden
:arga a b c d
:argdo echo "loading buffers"
:argu 3
:.-,$-RangeArguments
:%RangeArguments
:RangeArgumentsAll
:N
:.RangeArguments
:split|split|split|split
:3wincmd w
:.,$RangeWindows
:%RangeWindows
:RangeWindowsAll
:only
:blast|bd
:.,$RangeLoadedBuffers
:%RangeLoadedBuffers
:RangeLoadedBuffersAll
:.,$RangeBuffers
:%RangeBuffers
:RangeBuffersAll
:tabe|tabe|tabe|tabe
:normal 2gt
:.,$RangeTabs
:%RangeTabs
:RangeTabsAll
:1tabonly
:s/\n/\r\r\r\r\r/
:2ma<
:$-ma>
:'<,'>RangeLines
:com -range=% -buffer LocalRangeLines :call add(g:lines, 'LocalRangeLines '.<line1>.' '.<line2>)
:'<,'>LocalRangeLines
:b1
ENDTEST

STARTTEST
:call add(g:lines, '')
:%argd
:arga a b c d
:let v:errmsg = ''
:5argu
:call add(g:lines, '5argu ' . v:errmsg)
:$argu
:call add(g:lines, '4argu ' . expand('%:t'))
:let v:errmsg = ''
:1argu
:call add(g:lines, '1argu ' . expand('%:t'))
:let v:errmsg = ''
:100b
:call add(g:lines, '100b ' . v:errmsg)
:split|split|split|split
:let v:errmsg = ''
:0close
:call add(g:lines, '0close ' . v:errmsg)
:$wincmd w
:$close
:call add(g:lines, '$close ' . winnr())
:let v:errmsg = ''
:$+close
:call add(g:lines, '$+close ' . v:errmsg)
:$tabe
:call add(g:lines, '$tabe ' . tabpagenr())
:let v:errmsg = ''
:$+tabe
:call add(g:lines, '$+tabe ' . v:errmsg)
:only!
:e x
:0tabm
:normal 1gt
:call add(g:lines, '0tabm ' . expand('%:t'))
:tabonly!
:only!
:e! test.out
:call append(0, g:lines)
:unlet g:lines
:w|bd
:b1
ENDTEST

STARTTEST
:let g:lines = []
:func BufStatus()
:  call add(g:lines, 'aaa: ' . buflisted(g:buf_aaa) . ' bbb: ' . buflisted(g:buf_bbb) . ' ccc: ' . buflisted(g:buf_ccc))
:endfunc
:se nohidden
:e aaa
:let buf_aaa = bufnr('%')
:e bbb
:let buf_bbb = bufnr('%')
:e ccc
:let buf_ccc = bufnr('%')
:b1
:call BufStatus()
:exe buf_bbb . "," . buf_ccc . "bdelete"
:call BufStatus()
:exe buf_aaa . "bdelete"
:call BufStatus()
:e! test.out
:call append('$', g:lines)
:unlet g:lines
:delfunc BufStatus
:w|bd
:b1
ENDTEST

STARTTEST
:se hidden
:only!
:let g:lines = []
:%argd
:arga a b c d e f
:3argu
:let args = ''
:.,$-argdo let args .= ' '.expand('%')
:call add(g:lines, 'argdo:' . args)
:split|split|split|split
:2wincmd w
:let windows = ''
:.,$-windo let windows .= ' '.winnr()
:call add(g:lines, 'windo:'. windows)
:b2
:let buffers = ''
:.,$-bufdo let buffers .= ' '.bufnr('%')
:call add(g:lines, 'bufdo:' . buffers)
:3bd
:let buffers = ''
:3,7bufdo let buffers .= ' '.bufnr('%')
:call add(g:lines, 'bufdo:' . buffers)
:tabe|tabe|tabe|tabe
:normal! 2gt
:let tabpages = ''
:.,$-tabdo let tabpages .= ' '.tabpagenr()
:call add(g:lines, 'tabdo:' . tabpages)
:e! test.out
:call append('$', g:lines)
:w|qa!
ENDTEST