aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-12 22:56:58 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-12 23:20:56 -0500
commita4ea6027880211b15b5659054e6e14d384517e27 (patch)
treec65c1e34c4ea4a51c9467797858e7fad6ac34e0f /src/nvim/eval/funcs.c
parentb650d2d8d90a371d73a25be2d46dd3c8c0d935ab (diff)
downloadrneovim-a4ea6027880211b15b5659054e6e14d384517e27.tar.gz
rneovim-a4ea6027880211b15b5659054e6e14d384517e27.tar.bz2
rneovim-a4ea6027880211b15b5659054e6e14d384517e27.zip
vim-patch:8.2.2341: expresison command line completion incomplete after "g:"
Problem: Expresison command line completion shows variables but not functions after "g:". (Gary Johnson) Solution: Prefix "g:" when needed to a global function. https://github.com/vim/vim/commit/1bb4de5302ba038b9c59e845b6d735e87d5681d0 Port most of patch v8.2.0335 to complete script-local functions if the name starts with "s:".
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r--src/nvim/eval/funcs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index 25784c240f..2b04469af7 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -117,8 +117,12 @@ char_u *get_function_name(expand_T *xp, int idx)
intidx = -1;
if (intidx < 0) {
name = get_user_func_name(xp, idx);
- if (name != NULL)
+ if (name != NULL) {
+ if (*name != '<' && STRNCMP("g:", xp->xp_pattern, 2) == 0) {
+ return cat_prefix_varname('g', name);
+ }
return name;
+ }
}
while ((size_t)++intidx < ARRAY_SIZE(functions)
&& functions[intidx].name[0] == '\0') {