Mercurial > vim
comparison src/ex_getln.c @ 2128:a16af0072ea8 v7.2.410
updated for version 7.2.410
Problem: Highlighting directories for completion doesn't work properly.
Solution: Don't halve backslashes when not needed, expaned "~/".
(Dominique Pelle)
author | Bram Moolenaar <bram@zimbu.org> |
---|---|
date | Tue, 23 Mar 2010 18:06:52 +0100 |
parents | 63bf37c1e7a2 |
children | 03a5f2897db3 |
comparison
equal
deleted
inserted
replaced
2127:4e22214f8464 | 2128:a16af0072ea8 |
---|---|
3946 msg_putchar(' '); | 3946 msg_putchar(' '); |
3947 if (xp->xp_context == EXPAND_FILES | 3947 if (xp->xp_context == EXPAND_FILES |
3948 || xp->xp_context == EXPAND_SHELLCMD | 3948 || xp->xp_context == EXPAND_SHELLCMD |
3949 || xp->xp_context == EXPAND_BUFFERS) | 3949 || xp->xp_context == EXPAND_BUFFERS) |
3950 { | 3950 { |
3951 char_u *halved_slash; | |
3952 | |
3953 /* highlight directories */ | 3951 /* highlight directories */ |
3954 halved_slash = backslash_halve_save(files_found[k]); | 3952 if (xp->xp_numfiles != -1) |
3955 j = mch_isdir(halved_slash); | 3953 { |
3956 vim_free(halved_slash); | 3954 char_u *halved_slash; |
3955 char_u *exp_path; | |
3956 | |
3957 /* Expansion was done before and special characters | |
3958 * were escaped, need to halve backslashes. Also | |
3959 * $HOME has been replaced with ~/. */ | |
3960 exp_path = expand_env_save_opt(files_found[k], TRUE); | |
3961 halved_slash = backslash_halve_save( | |
3962 exp_path != NULL ? exp_path : files_found[k]); | |
3963 j = mch_isdir(halved_slash != NULL ? halved_slash | |
3964 : files_found[k]); | |
3965 vim_free(exp_path); | |
3966 vim_free(halved_slash); | |
3967 } | |
3968 else | |
3969 /* Expansion was done here, file names are literal. */ | |
3970 j = mch_isdir(files_found[k]); | |
3957 if (showtail) | 3971 if (showtail) |
3958 p = L_SHOWFILE(k); | 3972 p = L_SHOWFILE(k); |
3959 else | 3973 else |
3960 { | 3974 { |
3961 home_replace(NULL, files_found[k], NameBuff, MAXPATHL, | 3975 home_replace(NULL, files_found[k], NameBuff, MAXPATHL, |