Hi
Recent patch 7.2.401 fixed a bug with syntax highlighting of directories
with 'set wildmode=list'. I still see 2 other bugs with syntax highlighting
of directories.
Bug #1:
Starting vim with...
$ vim -u NONE -c 'set nocompatible wildmode=list'
... I notice that directories in are _not_ highlighted when doing:
:e ~/<Tab>
However, directories are correctly highlighted when doing:
:e ~user/<Tab> (where user is an actual user name)
or:
:e $HOME<Tab>
or:
:cd ~
:e <Tab>
Bug #2:
When completing with CTRL-D rather than Tab, backslash_halve_save(...)
should not be called since somehow, completion with CTRL-D does not
add the backslashes in file names unlike completion with <Tab>.
Attached patch fixes both issues.
Here is a test case:
# Create some odd directories for testing directory highlighting
$ mkdir -p ~/test_dir/{foobar,\\\\foobar,\$HOME}
$ ls -F test_dir
foobar/ \\foobar/ $HOME/
# Then verify that directories are correctly highlighted when doing:
:e ~/test_dir/<Tab>
and:
:e ~/test_dir/<C-d>
Bug #1 was already existing before patch 7.2.401
Bug #2 was introduced in patch 7.2.401
Cheers
-- Dominique
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
To unsubscribe from this group, send email to
vim_dev+unsubscribegooglegroups.com or reply to this email with the words
"REMOVE ME" as the subject.
diff -r 20d9fc2f13a4 src/ex_getln.c
--- a/src/ex_getln.c Fri Mar 19 23:08:48 2010 +0100
+++ b/src/ex_getln.c Sun Mar 21 05:00:54 2010 +0100
@@ -3948,12 +3948,21 @@
|| 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;
+
+ exp_path = expand_env_save_opt(files_found[k], TRUE);
+ halved_slash = backslash_halve_save(
+ exp_path ? exp_path : files_found[k]);
+ j = mch_isdir(halved_slash ? halved_slash : files_found[k]);
+ vim_free(exp_path);
+ vim_free(halved_slash);
+ }
+ else
+ j = mch_isdir(files_found[k]);
if (showtail)
p = L_SHOWFILE(k);
else