|
1 To: [email protected] |
|
2 Subject: Patch 7.2.313 |
|
3 Fcc: outbox |
|
4 From: Bram Moolenaar <[email protected]> |
|
5 Mime-Version: 1.0 |
|
6 Content-Type: text/plain; charset=UTF-8 |
|
7 Content-Transfer-Encoding: 8bit |
|
8 ------------ |
|
9 |
|
10 Patch 7.2.313 |
|
11 Problem: Command line completion doesn't work after "%:h" and similar. |
|
12 Solution: Expand these items before doing the completion. |
|
13 Files: src/ex_getln.c, src/misc1.c, src/proto/misc1.pro |
|
14 |
|
15 |
|
16 *** ../vim-7.2.312/src/ex_getln.c 2009-09-18 17:24:54.000000000 +0200 |
|
17 --- src/ex_getln.c 2009-12-02 16:40:06.000000000 +0100 |
|
18 *************** |
|
19 *** 4422,4428 **** |
|
20 flags |= EW_FILE; |
|
21 else |
|
22 flags = (flags | EW_DIR) & ~EW_FILE; |
|
23 ! ret = expand_wildcards(1, &pat, num_file, file, flags); |
|
24 if (free_pat) |
|
25 vim_free(pat); |
|
26 return ret; |
|
27 --- 4422,4429 ---- |
|
28 flags |= EW_FILE; |
|
29 else |
|
30 flags = (flags | EW_DIR) & ~EW_FILE; |
|
31 ! /* Expand wildcards, supporting %:h and the like. */ |
|
32 ! ret = expand_wildcards_eval(&pat, num_file, file, flags); |
|
33 if (free_pat) |
|
34 vim_free(pat); |
|
35 return ret; |
|
36 *** ../vim-7.2.312/src/misc1.c 2009-11-17 16:08:12.000000000 +0100 |
|
37 --- src/misc1.c 2009-12-02 17:06:49.000000000 +0100 |
|
38 *************** |
|
39 *** 8447,8452 **** |
|
40 --- 8447,8492 ---- |
|
41 } |
|
42 |
|
43 /* |
|
44 + * Invoke expand_wildcards() for one pattern. |
|
45 + * Expand items like "%:h" before the expansion. |
|
46 + * Returns OK or FAIL. |
|
47 + */ |
|
48 + int |
|
49 + expand_wildcards_eval(pat, num_file, file, flags) |
|
50 + char_u **pat; /* pointer to input pattern */ |
|
51 + int *num_file; /* resulting number of files */ |
|
52 + char_u ***file; /* array of resulting files */ |
|
53 + int flags; /* EW_DIR, etc. */ |
|
54 + { |
|
55 + int ret = FAIL; |
|
56 + char_u *eval_pat = NULL; |
|
57 + char_u *exp_pat = *pat; |
|
58 + char_u *ignored_msg; |
|
59 + int usedlen; |
|
60 + |
|
61 + if (*exp_pat == '%' || *exp_pat == '#' || *exp_pat == '<') |
|
62 + { |
|
63 + ++emsg_off; |
|
64 + eval_pat = eval_vars(exp_pat, exp_pat, &usedlen, |
|
65 + NULL, &ignored_msg, NULL); |
|
66 + --emsg_off; |
|
67 + if (eval_pat != NULL) |
|
68 + exp_pat = concat_str(eval_pat, exp_pat + usedlen); |
|
69 + } |
|
70 + |
|
71 + if (exp_pat != NULL) |
|
72 + ret = expand_wildcards(1, &exp_pat, num_file, file, flags); |
|
73 + |
|
74 + if (eval_pat != NULL) |
|
75 + { |
|
76 + vim_free(exp_pat); |
|
77 + vim_free(eval_pat); |
|
78 + } |
|
79 + |
|
80 + return ret; |
|
81 + } |
|
82 + |
|
83 + /* |
|
84 * Expand wildcards. Calls gen_expand_wildcards() and removes files matching |
|
85 * 'wildignore'. |
|
86 * Returns OK or FAIL. |
|
87 *** ../vim-7.2.312/src/proto/misc1.pro 2007-09-26 22:36:32.000000000 +0200 |
|
88 --- src/proto/misc1.pro 2009-12-02 16:41:52.000000000 +0100 |
|
89 *************** |
|
90 *** 85,90 **** |
|
91 --- 85,91 ---- |
|
92 int vim_fexists __ARGS((char_u *fname)); |
|
93 void line_breakcheck __ARGS((void)); |
|
94 void fast_breakcheck __ARGS((void)); |
|
95 + int expand_wildcards_eval __ARGS((char_u **pat, int *num_file, char_u ***file, int flags)); |
|
96 int expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags)); |
|
97 int match_suffix __ARGS((char_u *fname)); |
|
98 int unix_expandpath __ARGS((garray_T *gap, char_u *path, int wildoff, int flags, int didstar)); |
|
99 *** ../vim-7.2.312/src/version.c 2009-12-02 15:03:24.000000000 +0100 |
|
100 --- src/version.c 2009-12-02 17:14:02.000000000 +0100 |
|
101 *************** |
|
102 *** 683,684 **** |
|
103 --- 683,686 ---- |
|
104 { /* Add new patch number below this line */ |
|
105 + /**/ |
|
106 + 313, |
|
107 /**/ |
|
108 |
|
109 -- |
|
110 hundred-and-one symptoms of being an internet addict: |
|
111 8. You spend half of the plane trip with your laptop on your lap...and your |
|
112 child in the overhead compartment. |
|
113 |
|
114 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ |
|
115 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
|
116 \\\ download, build and distribute -- http://www.A-A-P.org /// |
|
117 \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |