summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-07-29 20:59:59 +0200
committerBram Moolenaar <Bram@vim.org>2010-07-29 20:59:59 +0200
commit1587a1e37db85425ae77054ab681a0bbb0d1affb (patch)
tree9223f33554da18ddc125929c4345d95ec1f1ed45 /src/misc1.c
parent8ada2cca0a6f0135441c520cac269468928e65ef (diff)
downloadvim-git-1587a1e37db85425ae77054ab681a0bbb0d1affb.tar.gz
Add completion for ":ownsyntax" and improve completion for ":filetype".
(Dominique Pelle)
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/misc1.c b/src/misc1.c
index c6ac00157..9b8bbf12d 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -9238,7 +9238,6 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
#if defined(FEAT_SEARCHPATH)
static int find_previous_pathsep __ARGS((char_u *path, char_u **psep));
static int is_unique __ARGS((char_u *maybe_unique, garray_T *gap, int i));
-static void remove_duplicates __ARGS((garray_T *gap));
static void expand_path_option __ARGS((char_u *curdir, garray_T *gap));
static char_u *get_path_cutoff __ARGS((char_u *fname, garray_T *gap));
static void uniquefy_paths __ARGS((garray_T *gap, char_u *pattern));
@@ -9302,29 +9301,6 @@ is_unique(maybe_unique, gap, i)
}
/*
- * Remove adjacent duplicate entries from "gap", which is a list of file names
- * in allocated memory.
- */
- static void
-remove_duplicates(gap)
- garray_T *gap;
-{
- int i;
- int j;
- char_u **fnames = (char_u **)gap->ga_data;
-
- for (i = 1; i < gap->ga_len; ++i)
- if (fnamecmp(fnames[i - 1], fnames[i]) == 0)
- {
- vim_free(fnames[i]);
- for (j = i + 1; j < gap->ga_len; ++j)
- fnames[j - 1] = fnames[j];
- --gap->ga_len;
- --i;
- }
-}
-
-/*
* Split the 'path' option to a an array of strings as garray_T. Relative
* paths are expanded to their equivalent fullpath. This includes the "."
* (relative to current buffer directory) and empty path (relative to current
@@ -9642,6 +9618,30 @@ expand_in_path(gap, pattern, flags)
}
#endif
+#if defined(FEAT_SEARCHPATH) || defined(FEAT_CMDL_COMPL) || defined(PROTO)
+/*
+ * Remove adjacent duplicate entries from "gap", which is a list of file names
+ * in allocated memory.
+ */
+ void
+remove_duplicates(gap)
+ garray_T *gap;
+{
+ int i;
+ int j;
+ char_u **fnames = (char_u **)gap->ga_data;
+
+ for (i = gap->ga_len - 1; i > 0; --i)
+ if (fnamecmp(fnames[i - 1], fnames[i]) == 0)
+ {
+ vim_free(fnames[i]);
+ for (j = i + 1; j < gap->ga_len; ++j)
+ fnames[j - 1] = fnames[j];
+ --gap->ga_len;
+ }
+}
+#endif
+
/*
* Generic wildcard expansion code.
*