summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-08-15 13:29:11 +0200
committerBram Moolenaar <Bram@vim.org>2010-08-15 13:29:11 +0200
commitd732f9aee0926487514f30d299d91a43afd3b458 (patch)
tree8086719df0f9a592656372f2488d9c4f1d345b02 /src/misc1.c
parent10d4664330b9379d5a54aa60c80c8069f73d822c (diff)
downloadvim-git-d732f9aee0926487514f30d299d91a43afd3b458.tar.gz
Two fixes for :find completion and more testing. (Nazri Ramliy)
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/misc1.c b/src/misc1.c
index c4a6015a0..fd178c99d 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -9722,6 +9722,9 @@ gen_expand_wildcards(num_pat, pat, num_file, file, flags)
char_u *p;
static int recursive = FALSE;
int add_pat;
+#if defined(FEAT_SEARCHPATH)
+ int did_expand_in_path = FALSE;
+#endif
/*
* expand_env() is called to expand things like "~user". If this fails,
@@ -9808,12 +9811,19 @@ gen_expand_wildcards(num_pat, pat, num_file, file, flags)
if (mch_has_exp_wildcard(p))
{
#if defined(FEAT_SEARCHPATH)
- if (*p != '.' && !vim_ispathsep(*p) && (flags & EW_PATH))
+ if ((flags & EW_PATH)
+ && !mch_isFullName(p)
+ && !(p[0] == '.'
+ && (vim_ispathsep(p[1])
+ || (p[1] == '.' && vim_ispathsep(p[2]))))
+ )
{
- /* recursiveness is OK here */
+ /* :find completion where 'path' is used.
+ * Recursiveness is OK here. */
recursive = FALSE;
add_pat = expand_in_path(&ga, p, flags);
recursive = TRUE;
+ did_expand_in_path = TRUE;
}
else
#endif
@@ -9838,7 +9848,7 @@ gen_expand_wildcards(num_pat, pat, num_file, file, flags)
}
#if defined(FEAT_SEARCHPATH)
- if (ga.ga_len > 0 && (flags & EW_PATH))
+ if (did_expand_in_path && ga.ga_len > 0 && (flags & EW_PATH))
uniquefy_paths(&ga, p);
#endif
if (p != pat[i])