Skip to content

Commit 6c5d104

Browse files
committed
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)
1 parent 1ebff3d commit 6c5d104

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/ex_docmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3764,7 +3764,7 @@ set_one_cmd_context(
37643764
* A full match ~user<Tab> will be replaced by user's home
37653765
* directory i.e. something like ~user<Tab> -> /home/user/ */
37663766
if (*p == NUL && p > xp->xp_pattern + 1
3767-
&& match_user(xp->xp_pattern + 1) == 1)
3767+
&& match_user(xp->xp_pattern + 1) >= 1)
37683768
{
37693769
xp->xp_context = EXPAND_USER;
37703770
++xp->xp_pattern;

src/misc1.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4827,7 +4827,8 @@ get_users(expand_T *xp UNUSED, int idx)
48274827
* 1 if name partially matches the beginning of a user name.
48284828
* 2 is name fully matches a user name.
48294829
*/
4830-
int match_user(char_u* name)
4830+
int
4831+
match_user(char_u *name)
48314832
{
48324833
int i;
48334834
int n = (int)STRLEN(name);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,8 @@ static char *(features[]) =
789789

790790
static int included_patches[] =
791791
{ /* Add new patch number below this line */
792+
/**/
793+
159,
792794
/**/
793795
158,
794796
/**/

0 commit comments

Comments
 (0)