patch 9.0.0081: command line completion of user command may have duplicates
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)
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index a69774e..1994a8c 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -842,6 +842,16 @@
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