1
0
forked from aniani/vim

updated for version 7.4.565

Problem:    Ranges for arguments, buffers, tabs, etc. are not checked to be
            valid but limited to the maximum.  This can cause the wrong thing
            to happen.
Solution:   Give an error for an invalid value. (Marcin Szamotulski)
            Use windows range for ":wincmd".
This commit is contained in:
Bram Moolenaar
2015-01-07 15:57:17 +01:00
parent 49a6ed8a8a
commit 3ffc79a4a8
9 changed files with 120 additions and 58 deletions

View File

@@ -1,8 +1,8 @@
Test for user command counts vim: set ft=vim :
STARTTEST
:let g:lines = []
:so tiny.vim
: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>)
@@ -48,6 +48,46 @@ STARTTEST
:'<,'>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)
:w|qa!