To: vim_dev@googlegroups.com Subject: Patch 8.2.3360 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3360 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) Files: src/evalfunc.c, src/testdir/test_cmdline.vim *** ../vim-8.2.3359/src/evalfunc.c 2021-08-16 21:38:38.131122584 +0200 --- src/evalfunc.c 2021-08-19 21:17:07.049486174 +0200 *************** *** 2307,2315 **** 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); return name; } --- 2307,2316 ---- if (intidx < 0) { name = get_user_func_name(xp, idx); ! if (name != NULL) { ! if (*name != NUL && *name != '<' ! && STRNCMP("g:", xp->xp_pattern, 2) == 0) return cat_prefix_varname('g', name); return name; } *** ../vim-8.2.3359/src/testdir/test_cmdline.vim 2021-08-14 21:11:47.500966948 +0200 --- src/testdir/test_cmdline.vim 2021-08-19 21:15:46.825654883 +0200 *************** *** 650,656 **** 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', @:) --- 650,656 ---- 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', @:) *************** *** 662,667 **** --- 662,675 ---- let Fx = { a -> a } call feedkeys(":echo g:\\\"\", '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\\\"\", 'tx') + call assert_match('"call Test_cmdline_complete_user_', @:) + delfunction s:a_dict_func endfunc func Test_cmdline_complete_user_names() *** ../vim-8.2.3359/src/version.c 2021-08-19 21:08:26.182565742 +0200 --- src/version.c 2021-08-19 21:19:42.917156797 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3360, /**/ -- So when I saw the post to comp.editors, I rushed over to the FTP site to grab it. So I yank apart the tarball, light x candles, where x= the vim version multiplied by the md5sum of the source divided by the MAC of my NIC (8A3FA78155A8A1D346C3C4A), put on black robes, dim the lights, wave a dead chicken over the hard drive, and summon the power of GNU GCC with the magic words "make config ; make!". [Jason Spence, compiling Vim 5.0] /// 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 ///