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\<Tab>\<Home>\"\<cr>",
'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:\<Tab>\<Home>\"\<cr>", '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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202108131549.17DFncPA3521765%40masaka.moolenaar.net.