forked from aniani/vim
updated for version 7.3.631
Problem: Cannot complete user names. Solution: Add user name completion. (Dominique Pelle)
This commit is contained in:
@@ -3515,6 +3515,23 @@ set_one_cmd_context(xp, buff)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if defined(FEAT_CMDL_COMPL)
|
||||
/* Check for user names */
|
||||
if (*xp->xp_pattern == '~')
|
||||
{
|
||||
for (p = xp->xp_pattern + 1; *p != NUL && *p != '/'; ++p)
|
||||
;
|
||||
/* Complete ~user only if it partially matches a user name.
|
||||
* A full match ~user<Tab> will be replaced by user's home
|
||||
* directory i.e. something like ~user<Tab> -> /home/user/ */
|
||||
if (*p == NUL && p > xp->xp_pattern + 1
|
||||
&& match_user(xp->xp_pattern + 1) == 1)
|
||||
{
|
||||
xp->xp_context = EXPAND_USER;
|
||||
++xp->xp_pattern;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5396,6 +5413,7 @@ static struct
|
||||
#endif
|
||||
{EXPAND_TAGS, "tag"},
|
||||
{EXPAND_TAGS_LISTFILES, "tag_listfiles"},
|
||||
{EXPAND_USER, "user"},
|
||||
{EXPAND_USER_VARS, "var"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
Reference in New Issue
Block a user