forked from aniani/vim
patch 7.4.2096
Problem: Lambda functions show up with completion. Solution: Don't show lambda functions. (Ken Takata)
This commit is contained in:
@@ -69,6 +69,11 @@ func Test_getcompletion()
|
|||||||
let l = getcompletion('tag', 'function')
|
let l = getcompletion('tag', 'function')
|
||||||
call assert_true(index(l, 'taglist(') >= 0)
|
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')
|
let l = getcompletion('run', 'file')
|
||||||
call assert_true(index(l, 'runtest.vim') >= 0)
|
call assert_true(index(l, 'runtest.vim') >= 0)
|
||||||
|
|
||||||
|
@@ -2554,8 +2554,9 @@ get_user_func_name(expand_T *xp, int idx)
|
|||||||
++hi;
|
++hi;
|
||||||
fp = HI2UF(hi);
|
fp = HI2UF(hi);
|
||||||
|
|
||||||
if (fp->uf_flags & FC_DICT)
|
if ((fp->uf_flags & FC_DICT)
|
||||||
return (char_u *)""; /* don't show dict functions */
|
|| STRNCMP(fp->uf_name, "<lambda>", 8) == 0)
|
||||||
|
return (char_u *)""; /* don't show dict and lambda functions */
|
||||||
|
|
||||||
if (STRLEN(fp->uf_name) + 4 >= IOSIZE)
|
if (STRLEN(fp->uf_name) + 4 >= IOSIZE)
|
||||||
return fp->uf_name; /* prevents overflow */
|
return fp->uf_name; /* prevents overflow */
|
||||||
|
@@ -758,6 +758,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2096,
|
||||||
/**/
|
/**/
|
||||||
2095,
|
2095,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user