# HG changeset patch # User Christian Brabandt # Date 1530974705 -7200 # Node ID 95030c5434110c607b8ffe8d421b03743b3d61da # Parent 446c03a9557897e3df17289c8dd11ea6af70e823 patch 8.1.0159: completion for user names does not work for a prefix. commit https://github.com/vim/vim/commit/6c5d1043022520512ee36aa1a29662b60af33c95 Author: Bram Moolenaar Date: Sat Jul 7 16:41:13 2018 +0200 patch 8.1.0159: completion for user names does not work for a prefix. 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) diff --git a/src/ex_docmd.c b/src/ex_docmd.c --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3764,7 +3764,7 @@ set_one_cmd_context( * A full match ~user will be replaced by user's home * directory i.e. something like ~user -> /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; diff --git a/src/misc1.c b/src/misc1.c --- a/src/misc1.c +++ b/src/misc1.c @@ -4827,7 +4827,8 @@ get_users(expand_T *xp UNUSED, int idx) * 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); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -790,6 +790,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 159, +/**/ 158, /**/ 157,