diff src/testdir/test_cmdline.vim @ 25648:46e2b5f66800 v8.2.3360

patch 8.2.3360: user function completion fails with dict function Commit: https://github.com/vim/vim/commit/5aec755b678cfd434b8ea2158d06992f33e1ff80 Author: naohiro ono <obcat@icloud.com> Date: Thu Aug 19 21:20:41 2021 +0200 patch 8.2.3360: user function completion fails with dict function Problem: User function completion fails with dict function. Solution: Do not stop sequencing through the list if user functions when encountering an empty name. (Naohiro Ono, closes #8765, closes #8774)
author Bram Moolenaar <Bram@vim.org>
date Thu, 19 Aug 2021 21:30:04 +0200
parents 28f1b7c38ba1
children ef38fc02faaa
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -650,7 +650,7 @@ 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 assert_match('"func Test_cmdline_complete_user_', @:)
   call feedkeys(":func s:ScriptL\<Tab>\<Home>\"\<cr>", 'tx')
   call assert_match('"func <SNR>\d\+_ScriptLocalFunction', @:)
 
@@ -662,6 +662,14 @@ func Test_cmdline_complete_user_func()
   let Fx = { a ->  a }
   call feedkeys(":echo g:\<Tab>\<Home>\"\<cr>", 'tx')
   call assert_match('"echo g:[A-Z]', @:)
+
+  " existence of script-local dict function does not break user function name
+  " completion
+  function s:a_dict_func() dict
+  endfunction
+  call feedkeys(":call Test_cmdline_complete_user\<Tab>\<Home>\"\<cr>", 'tx')
+  call assert_match('"call Test_cmdline_complete_user_', @:)
+  delfunction s:a_dict_func
 endfunc
 
 func Test_cmdline_complete_user_names()