comparison src/testdir/test_arglist.vim @ 13732:8ca1da2a043b v8.0.1738

patch 8.0.1738: ":args" output is hard to read commit https://github.com/vim/vim/commit/5d69da462f584a3aefb3427b127334bf9af3a4b0 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 20 22:01:41 2018 +0200 patch 8.0.1738: ":args" output is hard to read Problem: ":args" output is hard to read. Solution: Make columns with the names if the output is more than one line.
author Christian Brabandt <cb@256bit.org>
date Fri, 20 Apr 2018 22:15:06 +0200
parents 03a6aeea2096
children 3be5e8306a3e
comparison
equal deleted inserted replaced
13731:54708dd90a51 13732:8ca1da2a043b
120 augroup END 120 augroup END
121 121
122 call assert_equal(['d', 'c', 'b', 'a', 'c'], g:buffers) 122 call assert_equal(['d', 'c', 'b', 'a', 'c'], g:buffers)
123 123
124 redir => result 124 redir => result
125 ar 125 args
126 redir END 126 redir END
127 call assert_true(result =~# 'a b \[c] d') 127 call assert_equal('a b [c] d', trim(result))
128 128
129 .argd 129 .argd
130 call assert_equal(['a', 'b', 'd'], argv()) 130 call assert_equal(['a', 'b', 'd'], argv())
131 131
132 -argd 132 -argd
166 last | enew | argu 166 last | enew | argu
167 call assert_equal('z', expand('%:t')) 167 call assert_equal('z', expand('%:t'))
168 168
169 %argdelete 169 %argdelete
170 call assert_fails('argument', 'E163:') 170 call assert_fails('argument', 'E163:')
171 endfunc
172
173 func Test_list_arguments()
174 " Clean the argument list
175 arga a | %argd
176
177 " four args half the screen width makes two lines with two columns
178 let aarg = repeat('a', &columns / 2 - 4)
179 let barg = repeat('b', &columns / 2 - 4)
180 let carg = repeat('c', &columns / 2 - 4)
181 let darg = repeat('d', &columns / 2 - 4)
182 exe 'argadd ' aarg barg carg darg
183
184 redir => result
185 args
186 redir END
187 call assert_match('\[' . aarg . '] \+' . carg . '\n' . barg . ' \+' . darg, trim(result))
188
189 " if one arg is longer than half the screen make one column
190 exe 'argdel' aarg
191 let aarg = repeat('a', &columns / 2 + 2)
192 exe '0argadd' aarg
193 redir => result
194 args
195 redir END
196 call assert_match(aarg . '\n\[' . barg . ']\n' . carg . '\n' . darg, trim(result))
197
198 %argdelete
171 endfunc 199 endfunc
172 200
173 " Test for 0argadd and 0argedit 201 " Test for 0argadd and 0argedit
174 " Ported from the test_argument_0count.in test script 202 " Ported from the test_argument_0count.in test script
175 func Test_zero_argadd() 203 func Test_zero_argadd()