diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-07-26 17:23:47 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-26 17:23:47 +0100 |
commit | c2842adfb2ca0637f13e2793fefa18e7818684f9 (patch) | |
tree | 76b691a7a61aaf636af9e82fa7af8659bcd11847 /src/testdir/test_cmdline.vim | |
parent | 0494789ecee9e2a973f48426f7a69fb96378fa8a (diff) |
patch 9.0.0081: command line completion of user command may have duplicatesv9.0.0081
Problem: Command line completion of user command may have duplicates.
(Dani Dickstein)
Solution: Skip global user command if an identical buffer-local one is
defined. (closes #10797)
Diffstat (limited to 'src/testdir/test_cmdline.vim')
-rw-r--r-- | src/testdir/test_cmdline.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index a69774ee88..1994a8ca70 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -842,6 +842,16 @@ func Test_cmdline_complete_user_cmd() delcommand Foo endfunc +func Test_complete_user_cmd() + command FooBar echo 'global' + command -buffer FooBar echo 'local' + call feedkeys(":Foo\<C-A>\<Home>\"\<CR>", 'tx') + call assert_equal('"FooBar', @:) + + delcommand -buffer FooBar + delcommand FooBar +endfunc + func s:ScriptLocalFunction() echo 'yes' endfunc |