]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.410 v7.2.410
authorBram Moolenaar <Bram@vim.org>
Tue, 23 Mar 2010 17:06:52 +0000 (18:06 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 23 Mar 2010 17:06:52 +0000 (18:06 +0100)
Problem:    Highlighting directories for completion doesn't work properly.
Solution:   Don't halve backslashes when not needed, expaned "~/".
            (Dominique Pelle)

src/ex_getln.c
src/version.c

index dea4b13423bfb5cc7285c31159ec990a935b472d..6e74a23f1a738abf05d288d1e90dd42d472dab5e 100644 (file)
@@ -3948,12 +3948,26 @@ showmatches(xp, wildmenu)
                                          || xp->xp_context == EXPAND_SHELLCMD
                                          || xp->xp_context == EXPAND_BUFFERS)
                {
-                   char_u      *halved_slash;
-
                    /* highlight directories */
-                   halved_slash = backslash_halve_save(files_found[k]);
-                   j = mch_isdir(halved_slash);
-                   vim_free(halved_slash);
+                   if (xp->xp_numfiles != -1)
+                   {
+                       char_u  *halved_slash;
+                       char_u  *exp_path;
+
+                       /* Expansion was done before and special characters
+                        * were escaped, need to halve backslashes.  Also
+                        * $HOME has been replaced with ~/. */
+                       exp_path = expand_env_save_opt(files_found[k], TRUE);
+                       halved_slash = backslash_halve_save(
+                               exp_path != NULL ? exp_path : files_found[k]);
+                       j = mch_isdir(halved_slash != NULL ? halved_slash
+                                                           : files_found[k]);
+                       vim_free(exp_path);
+                       vim_free(halved_slash);
+                   }
+                   else
+                       /* Expansion was done here, file names are literal. */
+                       j = mch_isdir(files_found[k]);
                    if (showtail)
                        p = L_SHOWFILE(k);
                    else
index 5d340614894b7286c1d1dbcb1dbf55e4ef05b187..9cff4cea0c11a1d9624efbf54673d82a4c1f6ccb 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    410,
 /**/
     409,
 /**/