diff --git a/src/evalfunc.c b/src/evalfunc.c index 923a75024a..5b25e97cbe 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -2872,6 +2872,10 @@ get_function_name(expand_T *xp, int idx) } if (++intidx < (int)ARRAY_LENGTH(global_functions)) { + // Skip if the function doesn't have an implementation (feature not + // implemented). + if (global_functions[intidx].f_func == NULL) + return (char_u *)""; STRCPY(IObuff, global_functions[intidx].f_name); STRCAT(IObuff, "("); if (global_functions[intidx].f_max_argc == 0) diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index a832306208..9eca9186fa 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -489,6 +489,12 @@ func Test_getcompletion() let l = getcompletion('paint', 'function') call assert_equal([], l) + if !has('ruby') + " global_functions[] has an entry but it doesn't have an implemention + let l = getcompletion('ruby', 'function') + call assert_equal([], l) + endif + let Flambda = {-> 'hello'} let l = getcompletion('', 'function') let l = filter(l, {i, v -> v =~ 'lambda'}) diff --git a/src/version.c b/src/version.c index 4c7d8962cb..1cac4b5723 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1218, /**/ 1217, /**/