]> granicus.if.org Git - vim/commitdiff
patch 7.4.2096 v7.4.2096
authorBram Moolenaar <Bram@vim.org>
Sat, 23 Jul 2016 13:47:34 +0000 (15:47 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 23 Jul 2016 13:47:34 +0000 (15:47 +0200)
Problem:    Lambda functions show up with completion.
Solution:   Don't show lambda functions. (Ken Takata)

src/testdir/test_cmdline.vim
src/userfunc.c
src/version.c

index 054d39b0f09e54aff15473a4603b1e9b955ca6c1..0ddbcec265bcaa436ba65086a897b2cb7c603620 100644 (file)
@@ -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)
 
index af1863f32818b08c505f1b592221bbd0975c6299..32bcceece2c515b932b5ad87f799dbcedff2d988 100644 (file)
@@ -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, "<lambda>", 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 */
index 757590cb5686db7366cad30f1bd63bd1ba85ed1a..f47766b763690c3dd3975ed04d11ff84067bdd87 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2096,
 /**/
     2095,
 /**/