1
0
forked from aniani/vim

patch 8.2.3433: :delcommand does not take a -buffer option

Problem:    :delcommand does not take a -buffer option.
Solution:   Add the -buffer option.
This commit is contained in:
Bram Moolenaar
2021-09-12 20:58:02 +02:00
parent ca0627df69
commit bdcba24d85
5 changed files with 47 additions and 6 deletions

View File

@@ -656,4 +656,25 @@ func Test_usercmd_with_block()
call CheckScriptFailure(lines, 'E1231:')
endfunc
func Test_delcommand_buffer()
command Global echo 'global'
command -buffer OneBuffer echo 'one'
new
command -buffer TwoBuffer echo 'two'
call assert_equal(0, exists(':OneBuffer'))
call assert_equal(2, exists(':Global'))
call assert_equal(2, exists(':TwoBuffer'))
delcommand -buffer TwoBuffer
call assert_equal(0, exists(':TwoBuffer'))
call assert_fails('delcommand -buffer Global', 'E1237:')
call assert_fails('delcommand -buffer OneBuffer', 'E1237:')
bwipe!
call assert_equal(2, exists(':OneBuffer'))
delcommand -buffer OneBuffer
call assert_equal(0, exists(':OneBuffer'))
call assert_fails('delcommand -buffer Global', 'E1237:')
delcommand Global
call assert_equal(0, exists(':Global'))
endfunc
" vim: shiftwidth=2 sts=2 expandtab