# HG changeset patch # User Christian Brabandt # Date 1469282406 -7200 # Node ID af0d98d8836e3c826a8744326416aa9f7545d9bb # Parent 75c25d1de77eb6eb5fa21a554720da0ce0852543 commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038 Author: Bram Moolenaar Date: Sat Jul 23 15:47:34 2016 +0200 patch 7.4.2096 Problem: Lambda functions show up with completion. Solution: Don't show lambda functions. (Ken Takata) diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -69,6 +69,11 @@ func Test_getcompletion() let l = getcompletion('tag', 'function') call assert_true(index(l, 'taglist(') >= 0) + let Flambda = {-> 'hello'} + let l = getcompletion('', 'function') + let l = filter(l, {i, v -> v =~ 'lambda'}) + call assert_equal(0, len(l)) + let l = getcompletion('run', 'file') call assert_true(index(l, 'runtest.vim') >= 0) diff --git a/src/userfunc.c b/src/userfunc.c --- a/src/userfunc.c +++ b/src/userfunc.c @@ -2554,8 +2554,9 @@ get_user_func_name(expand_T *xp, int idx ++hi; fp = HI2UF(hi); - if (fp->uf_flags & FC_DICT) - return (char_u *)""; /* don't show dict functions */ + if ((fp->uf_flags & FC_DICT) + || STRNCMP(fp->uf_name, "", 8) == 0) + return (char_u *)""; /* don't show dict and lambda functions */ if (STRLEN(fp->uf_name) + 4 >= IOSIZE) return fp->uf_name; /* prevents overflow */ diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2096, +/**/ 2095, /**/ 2094,