1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: "filetype" completion doesn't work on Windows. (Yue Wu)
12 Solution: Don't use a glob pattern for the directories, use a list of
13 directories. (Dominique Pelle)
17 *** ../vim-7.3.236/src/ex_getln.c 2011-05-19 18:26:34.000000000 +0200
18 --- src/ex_getln.c 2011-06-26 19:36:36.000000000 +0200
21 static int expand_showtail __ARGS((expand_T *xp));
22 #ifdef FEAT_CMDL_COMPL
23 static int expand_shellcmd __ARGS((char_u *filepat, int *num_file, char_u ***file, int flagsarg));
24 ! static int ExpandRTDir __ARGS((char_u *pat, int *num_file, char_u ***file, char *dirname));
25 # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
26 static int ExpandUserDefined __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file));
27 static int ExpandUserList __ARGS((expand_T *xp, int *num_file, char_u ***file));
29 static int expand_showtail __ARGS((expand_T *xp));
30 #ifdef FEAT_CMDL_COMPL
31 static int expand_shellcmd __ARGS((char_u *filepat, int *num_file, char_u ***file, int flagsarg));
32 ! static int ExpandRTDir __ARGS((char_u *pat, int *num_file, char_u ***file, char *dirname[]));
33 # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
34 static int ExpandUserDefined __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file));
35 static int ExpandUserList __ARGS((expand_T *xp, int *num_file, char_u ***file));
38 || xp->xp_context == EXPAND_TAGS_LISTFILES)
39 return expand_tags(xp->xp_context == EXPAND_TAGS, pat, num_file, file);
40 if (xp->xp_context == EXPAND_COLORS)
41 ! return ExpandRTDir(pat, num_file, file, "colors");
42 if (xp->xp_context == EXPAND_COMPILER)
43 ! return ExpandRTDir(pat, num_file, file, "compiler");
44 if (xp->xp_context == EXPAND_OWNSYNTAX)
45 ! return ExpandRTDir(pat, num_file, file, "syntax");
46 if (xp->xp_context == EXPAND_FILETYPE)
47 ! return ExpandRTDir(pat, num_file, file, "{syntax,indent,ftplugin}");
48 # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
49 if (xp->xp_context == EXPAND_USER_LIST)
50 return ExpandUserList(xp, num_file, file);
52 || xp->xp_context == EXPAND_TAGS_LISTFILES)
53 return expand_tags(xp->xp_context == EXPAND_TAGS, pat, num_file, file);
54 if (xp->xp_context == EXPAND_COLORS)
56 ! char *directories[] = {"colors", NULL};
57 ! return ExpandRTDir(pat, num_file, file, directories);
59 if (xp->xp_context == EXPAND_COMPILER)
61 ! char *directories[] = {"colors", NULL};
62 ! return ExpandRTDir(pat, num_file, file, directories);
64 if (xp->xp_context == EXPAND_OWNSYNTAX)
66 ! char *directories[] = {"syntax", NULL};
67 ! return ExpandRTDir(pat, num_file, file, directories);
69 if (xp->xp_context == EXPAND_FILETYPE)
71 ! char *directories[] = {"syntax", "indent", "ftplugin", NULL};
72 ! return ExpandRTDir(pat, num_file, file, directories);
74 # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
75 if (xp->xp_context == EXPAND_USER_LIST)
76 return ExpandUserList(xp, num_file, file);
80 * Expand color scheme, compiler or filetype names:
81 * 'runtimepath'/{dirnames}/{pat}.vim
82 ! * dirnames may contain one directory (ex: "colorscheme") or can be a glob
83 ! * expression matching multiple directories (ex: "{syntax,ftplugin,indent}").
86 ExpandRTDir(pat, num_file, file, dirnames)
99 ! s = alloc((unsigned)(STRLEN(pat) + STRLEN(dirnames) + 7));
102 ! sprintf((char *)s, "%s/%s*.vim", dirnames, pat);
103 ! all = globpath(p_rtp, s, 0);
108 ! ga_init2(&ga, (int)sizeof(char *), 3);
109 ! for (s = all; *s != NUL; s = e)
111 ! e = vim_strchr(s, '\n');
114 ! if (ga_grow(&ga, 1) == FAIL)
116 ! if (e - 4 > s && STRNICMP(e - 4, ".vim", 4) == 0)
118 ! for (s = e - 4; s > all; mb_ptr_back(all, s))
119 ! if (*s == '\n' || vim_ispathsep(*s))
122 ! ((char_u **)ga.ga_data)[ga.ga_len] =
123 vim_strnsave(s, (int)(e - s - 4));
131 /* Sort and remove duplicates which can happen when specifying multiple
132 ! * directories in dirnames such as "{syntax,ftplugin,indent}". */
133 remove_duplicates(&ga);
138 * Expand color scheme, compiler or filetype names:
139 * 'runtimepath'/{dirnames}/{pat}.vim
140 ! * "dirnames" is an array with one or more directory names.
143 ExpandRTDir(pat, num_file, file, dirnames)
158 ! pat_len = STRLEN(pat);
159 ! ga_init2(&ga, (int)sizeof(char *), 10);
161 ! for (i = 0; dirnames[i] != NULL; ++i)
163 ! s = alloc((unsigned)(STRLEN(dirnames[i]) + pat_len + 7));
166 ! ga_clear_strings(&ga);
169 ! sprintf((char *)s, "%s/%s*.vim", dirnames[i], pat);
170 ! matches = globpath(p_rtp, s, 0);
172 ! if (matches == NULL)
175 ! for (s = matches; *s != NUL; s = e)
177 ! e = vim_strchr(s, '\n');
180 ! if (ga_grow(&ga, 1) == FAIL)
182 ! if (e - 4 > s && STRNICMP(e - 4, ".vim", 4) == 0)
184 ! for (s = e - 4; s > matches; mb_ptr_back(matches, s))
185 ! if (*s == '\n' || vim_ispathsep(*s))
188 ! ((char_u **)ga.ga_data)[ga.ga_len] =
189 vim_strnsave(s, (int)(e - s - 4));
197 ! if (ga.ga_len == 0)
200 /* Sort and remove duplicates which can happen when specifying multiple
201 ! * directories in dirnames. */
202 remove_duplicates(&ga);
205 *** ../vim-7.3.236/src/version.c 2011-06-26 19:13:33.000000000 +0200
206 --- src/version.c 2011-06-26 19:39:39.000000000 +0200
210 { /* Add new patch number below this line */
216 hundred-and-one symptoms of being an internet addict:
217 230. You spend your Friday nights typing away at your keyboard
219 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
220 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
221 \\\ an exciting new programming language -- http://www.Zimbu.org ///
222 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///