diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2022-01-29 17:00:37 +0000 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2022-01-30 22:25:08 +0000 |
commit | f8f0f14db2e8096e77ed60171d360ac2605b7c80 (patch) | |
tree | 45411434005647922f9241a1940cef78938a07b5 /src/nvim/testdir | |
parent | a28a9aec635676873e18e1ffe8d2334dd00a7ad3 (diff) | |
download | rneovim-f8f0f14db2e8096e77ed60171d360ac2605b7c80.tar.gz rneovim-f8f0f14db2e8096e77ed60171d360ac2605b7c80.tar.bz2 rneovim-f8f0f14db2e8096e77ed60171d360ac2605b7c80.zip |
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.
https://github.com/vim/vim/commit/bdcba24d8597abd5af509c2fb9206e64e713c711
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_usercommands.vim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_usercommands.vim b/src/nvim/testdir/test_usercommands.vim index 481959d43d..2c4bf1bda5 100644 --- a/src/nvim/testdir/test_usercommands.vim +++ b/src/nvim/testdir/test_usercommands.vim @@ -551,3 +551,26 @@ func Test_command_list() call assert_equal("\nNo user-defined commands found", execute(':command Xxx')) call assert_equal("\nNo user-defined commands found", execute('command')) 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 |