aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-12 22:56:58 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-12 23:20:56 -0500
commita4ea6027880211b15b5659054e6e14d384517e27 (patch)
treec65c1e34c4ea4a51c9467797858e7fad6ac34e0f /src/nvim/testdir
parentb650d2d8d90a371d73a25be2d46dd3c8c0d935ab (diff)
downloadrneovim-a4ea6027880211b15b5659054e6e14d384517e27.tar.gz
rneovim-a4ea6027880211b15b5659054e6e14d384517e27.tar.bz2
rneovim-a4ea6027880211b15b5659054e6e14d384517e27.zip
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:".
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_cmdline.vim15
1 files changed, 15 insertions, 0 deletions
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\<Tab>\<Home>\"\<cr>", 'tx')
+ call assert_match('"func Test_cmdline_complete_user', @:)
+ call feedkeys(":func s:ScriptL\<Tab>\<Home>\"\<cr>", 'tx')
+ call assert_match('"func <SNR>\d\+_ScriptLocalFunction', @:)
+
+ " g: prefix also works
+ call feedkeys(":echo g:Test_cmdline_complete_user_f\<Tab>\<Home>\"\<cr>", '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]