Problem: Completion for user names does not work if a prefix is also a full
matching name. (Nazri Ramliy)
Solution: Accept both full and partial matches. (Dominique Pelle)
* 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)
+ && match_user(xp->xp_pattern + 1) >= 1)
{
xp->xp_context = EXPAND_USER;
++xp->xp_pattern;
* 1 if name partially matches the beginning of a user name.
* 2 is name fully matches a user name.
*/
-int match_user(char_u* name)
+ int
+match_user(char_u *name)
{
int i;
int n = (int)STRLEN(name);
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 159,
/**/
158,
/**/