From a4ea6027880211b15b5659054e6e14d384517e27 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 12 Mar 2021 22:56:58 -0500 Subject: vim-patch:8.2.2341: expresison command line completion incomplete after "g:" Problem: Expresison command line completion shows variables but not functions after "g:". (Gary Johnson) Solution: Prefix "g:" when needed to a global function. https://github.com/vim/vim/commit/1bb4de5302ba038b9c59e845b6d735e87d5681d0 Port most of patch v8.2.0335 to complete script-local functions if the name starts with "s:". --- src/nvim/testdir/test_cmdline.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index a66aee5e02..489b2477e6 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -569,6 +569,21 @@ func Test_cmdline_complete_user_cmd() delcommand Foo endfunc +func s:ScriptLocalFunction() + echo 'yes' +endfunc + +func Test_cmdline_complete_user_func() + call feedkeys(":func Test_cmdline_complete_user\\\"\", 'tx') + call assert_match('"func Test_cmdline_complete_user', @:) + call feedkeys(":func s:ScriptL\\\"\", 'tx') + call assert_match('"func \d\+_ScriptLocalFunction', @:) + + " g: prefix also works + call feedkeys(":echo g:Test_cmdline_complete_user_f\\\"\", 'tx') + call assert_match('"echo g:Test_cmdline_complete_user_func', @:) +endfunc + func Test_cmdline_complete_user_names() if has('unix') && executable('whoami') let whoami = systemlist('whoami')[0] -- cgit