view src/testdir/test_command_count.in @ 7615:228ff048db20 v7.4.1107

commit https://github.com/vim/vim/commit/da440d21a6b94d7f525fa7be9b1417c78dd9aa4c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 16 21:27:23 2016 +0100 patch 7.4.1107 Problem: Vim can create a directory but not delete it. Solution: Add an argument to delete() to make it possible to delete a directory, also recursively.
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Jan 2016 21:30:05 +0100
parents ceda6d8af447
children
line wrap: on
line source

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