Skip to content

Commit b49edc1

Browse files
committed
patch 7.4.2096
Problem: Lambda functions show up with completion. Solution: Don't show lambda functions. (Ken Takata)
1 parent 61c0449 commit b49edc1

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/testdir/test_cmdline.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ func Test_getcompletion()
6969
let l = getcompletion('tag', 'function')
7070
call assert_true(index(l, 'taglist(') >= 0)
7171

72+
let Flambda = {-> 'hello'}
73+
let l = getcompletion('', 'function')
74+
let l = filter(l, {i, v -> v =~ 'lambda'})
75+
call assert_equal(0, len(l))
76+
7277
let l = getcompletion('run', 'file')
7378
call assert_true(index(l, 'runtest.vim') >= 0)
7479

src/userfunc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2554,8 +2554,9 @@ get_user_func_name(expand_T *xp, int idx)
25542554
++hi;
25552555
fp = HI2UF(hi);
25562556

2557-
if (fp->uf_flags & FC_DICT)
2558-
return (char_u *)""; /* don't show dict functions */
2557+
if ((fp->uf_flags & FC_DICT)
2558+
|| STRNCMP(fp->uf_name, "<lambda>", 8) == 0)
2559+
return (char_u *)""; /* don't show dict and lambda functions */
25592560

25602561
if (STRLEN(fp->uf_name) + 4 >= IOSIZE)
25612562
return fp->uf_name; /* prevents overflow */

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ static char *(features[]) =
758758

759759
static int included_patches[] =
760760
{ /* Add new patch number below this line */
761+
/**/
762+
2096,
761763
/**/
762764
2095,
763765
/**/

0 commit comments

Comments
 (0)