diff options
author | Michael Ennen <mike.ennen@gmail.com> | 2016-12-15 12:48:41 -0700 |
---|---|---|
committer | Michael Ennen <mike.ennen@gmail.com> | 2017-02-14 17:38:17 -0700 |
commit | cbaa87a63912ea64a4c8027532b86114a6571a19 (patch) | |
tree | 3fdf0be4e8d17b984bfac332a004190532519d57 | |
parent | 7f4848aff47b7b2a85be5f83007846934ef9fd90 (diff) | |
download | rneovim-cbaa87a63912ea64a4c8027532b86114a6571a19.tar.gz rneovim-cbaa87a63912ea64a4c8027532b86114a6571a19.tar.bz2 rneovim-cbaa87a63912ea64a4c8027532b86114a6571a19.zip |
vim-patch:7.4.2096
Problem: Lambda functions show up with completion.
Solution: Don't show lambda functions. (Ken Takata)
https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
-rw-r--r-- | src/nvim/eval.c | 6 | ||||
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 5 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index e64d24baa0..0766fc8ee8 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -21839,8 +21839,10 @@ char_u *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 */ diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 21bb057fe1..40db227d97 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -85,6 +85,11 @@ func Test_getcompletion() let l = getcompletion('paint', 'function') call assert_equal([], l) + 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) let l = getcompletion('walk', 'file') diff --git a/src/nvim/version.c b/src/nvim/version.c index 3e9e543490..b9b323b79f 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -344,7 +344,7 @@ static int included_patches[] = { 2099, // 2098, // 2097, - // 2096, + 2096, // 2095, // 2094 NA // 2093 NA |