To: vim_dev@googlegroups.com Subject: Patch 8.2.3337 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3337 Problem: Completing "call g:" returns entries with just "g:". (Naohiro Ono) Solution: Skip empty strings returned by get_user_func_name(). (closes #8753) Files: src/evalfunc.c, src/testdir/test_cmdline.vim *** ../vim-8.2.3336/src/evalfunc.c 2021-08-12 17:06:01.392925681 +0200 --- src/evalfunc.c 2021-08-13 17:47:55.458951195 +0200 *************** *** 2304,2310 **** if (intidx < 0) { name = get_user_func_name(xp, idx); ! if (name != NULL) { if (*name != '<' && STRNCMP("g:", xp->xp_pattern, 2) == 0) return cat_prefix_varname('g', name); --- 2304,2310 ---- if (intidx < 0) { name = get_user_func_name(xp, idx); ! if (name != NULL && *name != NUL) { if (*name != '<' && STRNCMP("g:", xp->xp_pattern, 2) == 0) return cat_prefix_varname('g', name); *** ../vim-8.2.3336/src/testdir/test_cmdline.vim 2021-06-13 18:38:44.688673497 +0200 --- src/testdir/test_cmdline.vim 2021-08-13 17:47:11.123056648 +0200 *************** *** 657,662 **** --- 657,667 ---- " g: prefix also works call feedkeys(":echo g:Test_cmdline_complete_user_f\\\"\", 'tx') call assert_match('"echo g:Test_cmdline_complete_user_func', @:) + + " using g: prefix does not result in just "g:" matches from a lambda + let Fx = { a -> a } + call feedkeys(":echo g:\\\"\", 'tx') + call assert_match('"echo g:[A-Z]', @:) endfunc func Test_cmdline_complete_user_names() *** ../vim-8.2.3336/src/version.c 2021-08-12 21:12:52.899143984 +0200 --- src/version.c 2021-08-13 17:37:04.188546401 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3337, /**/ -- TALL KNIGHT: When you have found the shrubbery, then you must cut down the mightiest tree in the forest ... with a herring. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///