{
name = get_user_func_name(xp, idx);
if (name != NULL)
+ {
+ if (*name != '<' && STRNCMP("g:", xp->xp_pattern, 2) == 0)
+ return cat_prefix_varname('g', name);
return name;
+ }
}
if (++intidx < (int)(sizeof(global_functions) / sizeof(funcentry_T)))
{
/*
* Function to concatenate a prefix and a variable name.
*/
- static char_u *
+ char_u *
cat_prefix_varname(int prefix, char_u *name)
{
int len;
int do_unlet(char_u *name, int forceit);
void item_lock(typval_T *tv, int deep, int lock, int check_refcount);
void del_menutrans_vars(void);
+char_u *cat_prefix_varname(int prefix, char_u *name);
char_u *get_user_var_name(expand_T *xp, int idx);
char *get_var_special_name(int nr);
dict_T *get_globvar_dict(void);
call assert_match('"func Test_cmdline_complete_user', @:)
call feedkeys(":func s:ScriptL\<Tab>\<Home>\"\<cr>", 'tx')
call assert_match('"func <SNR>\d\+_ScriptLocalFunction', @:)
+
+ " g: prefix also works
+ call feedkeys(":echo g:Test_cmdline_complete_user_f\<Tab>\<Home>\"\<cr>", 'tx')
+ call assert_match('"echo g:Test_cmdline_complete_user_func', @:)
endfunc
func Test_cmdline_complete_user_names()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2341,
/**/
2340,
/**/