forked from aniani/vim
patch 8.2.1280: Ex command error cannot contain an argument
Problem: Ex command error cannot contain an argument.
Solution: Add ex_errmsg() and translate earlier. Use e_trailing_arg where
possible.
This commit is contained in:
@@ -135,18 +135,18 @@ function Test_tabpage()
|
||||
call assert_fails("99tabmove", 'E16:')
|
||||
call assert_fails("+99tabmove", 'E16:')
|
||||
call assert_fails("-99tabmove", 'E16:')
|
||||
call assert_fails("tabmove foo", 'E474:')
|
||||
call assert_fails("tabmove 99", 'E474:')
|
||||
call assert_fails("tabmove +99", 'E474:')
|
||||
call assert_fails("tabmove -99", 'E474:')
|
||||
call assert_fails("tabmove -3+", 'E474:')
|
||||
call assert_fails("tabmove $3", 'E474:')
|
||||
call assert_fails("tabmove foo", 'E475:')
|
||||
call assert_fails("tabmove 99", 'E475:')
|
||||
call assert_fails("tabmove +99", 'E475:')
|
||||
call assert_fails("tabmove -99", 'E475:')
|
||||
call assert_fails("tabmove -3+", 'E475:')
|
||||
call assert_fails("tabmove $3", 'E475:')
|
||||
call assert_fails("%tabonly", 'E16:')
|
||||
1tabonly!
|
||||
tabmove 1
|
||||
call assert_equal(1, tabpagenr())
|
||||
tabnew
|
||||
call assert_fails("-2tabmove", 'E474:')
|
||||
call assert_fails("-2tabmove", 'E16:')
|
||||
tabonly!
|
||||
endfunc
|
||||
|
||||
@@ -324,14 +324,14 @@ function Test_tabpage_with_tabnext()
|
||||
call Check_tab_count(4, 'tabnext -', 3)
|
||||
call Check_tab_count(4, 'tabnext -2', 2)
|
||||
call Check_tab_count(3, 'tabnext $', 5)
|
||||
call assert_fails('tabnext 0', 'E474:')
|
||||
call assert_fails('tabnext .', 'E474:')
|
||||
call assert_fails('tabnext -+', 'E474:')
|
||||
call assert_fails('tabnext +2-', 'E474:')
|
||||
call assert_fails('tabnext $3', 'E474:')
|
||||
call assert_fails('tabnext 99', 'E474:')
|
||||
call assert_fails('tabnext +99', 'E474:')
|
||||
call assert_fails('tabnext -99', 'E474:')
|
||||
call assert_fails('tabnext 0', 'E475:')
|
||||
call assert_fails('tabnext .', 'E475:')
|
||||
call assert_fails('tabnext -+', 'E475:')
|
||||
call assert_fails('tabnext +2-', 'E475:')
|
||||
call assert_fails('tabnext $3', 'E475:')
|
||||
call assert_fails('tabnext 99', 'E475:')
|
||||
call assert_fails('tabnext +99', 'E475:')
|
||||
call assert_fails('tabnext -99', 'E475:')
|
||||
|
||||
1tabonly!
|
||||
endfunction
|
||||
@@ -356,7 +356,7 @@ function Test_tabpage_with_tabprevious()
|
||||
let err_code = 'E16:'
|
||||
else
|
||||
let entire_cmd = cmd . ' ' . c
|
||||
let err_code = 'E474:'
|
||||
let err_code = 'E475:'
|
||||
endif
|
||||
call assert_fails(entire_cmd, err_code)
|
||||
endfor
|
||||
@@ -455,7 +455,7 @@ function Test_tabpage_with_tabclose()
|
||||
let err_code = 'E16:'
|
||||
else
|
||||
let entire_cmd = 'tabclose ' . c
|
||||
let err_code = 'E474:'
|
||||
let err_code = 'E475:'
|
||||
endif
|
||||
call assert_fails(entire_cmd, err_code)
|
||||
call assert_equal(6, tabpagenr('$'))
|
||||
@@ -464,8 +464,8 @@ function Test_tabpage_with_tabclose()
|
||||
|
||||
call assert_fails('3tabclose', 'E37:')
|
||||
call assert_fails('tabclose 3', 'E37:')
|
||||
call assert_fails('tabclose -+', 'E474:')
|
||||
call assert_fails('tabclose +2-', 'E474:')
|
||||
call assert_fails('tabclose -+', 'E475:')
|
||||
call assert_fails('tabclose +2-', 'E475:')
|
||||
call assert_equal(6, tabpagenr('$'))
|
||||
|
||||
1tabonly!
|
||||
@@ -510,7 +510,7 @@ function Test_tabpage_with_tabonly()
|
||||
let err_code = 'E16:'
|
||||
else
|
||||
let entire_cmd = 'tabonly ' . c
|
||||
let err_code = 'E474:'
|
||||
let err_code = 'E475:'
|
||||
endif
|
||||
call assert_fails(entire_cmd, err_code)
|
||||
call assert_equal(6, tabpagenr('$'))
|
||||
@@ -521,13 +521,13 @@ function Test_tabpage_with_tabonly()
|
||||
for c in tc
|
||||
call s:reconstruct_tabpage_for_test(6)
|
||||
let entire_cmd = 'tabonly' . c[2] . ' ' . c[1]
|
||||
let err_code = 'E474:'
|
||||
let err_code = 'E475:'
|
||||
call assert_fails(entire_cmd, err_code)
|
||||
call assert_equal(6, tabpagenr('$'))
|
||||
endfor
|
||||
|
||||
call assert_fails('tabonly -+', 'E474:')
|
||||
call assert_fails('tabonly +2-', 'E474:')
|
||||
call assert_fails('tabonly -+', 'E475:')
|
||||
call assert_fails('tabonly +2-', 'E475:')
|
||||
call assert_equal(6, tabpagenr('$'))
|
||||
|
||||
1tabonly!
|
||||
|
||||
Reference in New Issue
Block a user