]> granicus.if.org Git - vim/commitdiff
patch 8.1.0159: completion for user names does not work for a prefix. v8.1.0159
authorBram Moolenaar <Bram@vim.org>
Sat, 7 Jul 2018 14:41:13 +0000 (16:41 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 7 Jul 2018 14:41:13 +0000 (16:41 +0200)
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)

src/ex_docmd.c
src/misc1.c
src/version.c

index e198a286af98e8e54d440fc3e97a84e0efb51f1a..4b3fdac37542c3aa2ed0e3348de6035420193ca4 100644 (file)
@@ -3764,7 +3764,7 @@ set_one_cmd_context(
             * 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;
index 5242ca572917ed893227a2fdd5a9dba03252e169..f0e629b5bd085996072ec21c2820c309daa94ec2 100644 (file)
@@ -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);
index c8dde84e1e4cb417402babdb982f9a014cb5dd12..e19f35e9dc0bcca41c59bc1d2143464732d4605c 100644 (file)
@@ -789,6 +789,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    159,
 /**/
     158,
 /**/