Mercurial > vim
diff src/misc1.c @ 2433:98b9a6b9e7d5 vim73
Add completion for ":ownsyntax" and improve completion for ":filetype".
(Dominique Pelle)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 29 Jul 2010 20:59:59 +0200 |
parents | 7ce8b24450dc |
children | 291edb23ab17 |
line wrap: on
line diff
--- a/src/misc1.c +++ b/src/misc1.c @@ -9238,7 +9238,6 @@ unix_expandpath(gap, path, wildoff, flag #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. *