4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When using <f-args> in a user command it's not possible to have an
13 Solution: Change the handling of backslashes. (Yakov Lerner)
14 Files: runtime/doc/map.txt, src/ex_docmd.c
17 *** ../vim-7.0.213/runtime/doc/map.txt Sun May 7 16:57:11 2006
18 --- runtime/doc/map.txt Thu Mar 8 18:00:26 2007
21 ! *map.txt* For Vim version 7.0. Last change: 2006 May 03
24 VIM REFERENCE MANUAL by Bram Moolenaar
26 ! *map.txt* For Vim version 7.0. Last change: 2007 Mar 08
29 VIM REFERENCE MANUAL by Bram Moolenaar
32 <q-args>) then the value is quoted in such a way as to make it a valid value
33 for use in an expression. This uses the argument as one single value.
34 When there is no argument <q-args> is an empty string.
36 To allow commands to pass their arguments on to a user-defined function, there
37 is a special form <f-args> ("function args"). This splits the command
38 arguments at spaces and Tabs, quotes each argument individually, and the
39 <f-args> sequence is replaced by the comma-separated list of quoted arguments.
40 See the Mycmd example below. If no arguments are given <f-args> is removed.
45 <q-args>) then the value is quoted in such a way as to make it a valid value
46 for use in an expression. This uses the argument as one single value.
47 When there is no argument <q-args> is an empty string.
49 To allow commands to pass their arguments on to a user-defined function, there
50 is a special form <f-args> ("function args"). This splits the command
51 arguments at spaces and Tabs, quotes each argument individually, and the
52 <f-args> sequence is replaced by the comma-separated list of quoted arguments.
53 See the Mycmd example below. If no arguments are given <f-args> is removed.
54 + To embed whitespace into an argument of <f-args>, prepend a backslash.
55 + <f-args> replaces every pair of backslashes (\\) with one backslash. A
56 + backslash followed by a character other than white space or a backslash
57 + remains unmodified. Overview:
69 + XX a\\\\ b 'a\\', 'b'
73 *** ../vim-7.0.213/src/ex_docmd.c Tue Nov 28 21:41:19 2006
74 --- src/ex_docmd.c Thu Mar 8 17:49:11 2007
78 mch_memmove(cmd, cmd + 1, (gap->ga_len - i) * sizeof(ucmd_T));
82 + * split and quote args for <f-args>
85 uc_split_args(arg, lenp)
92 ! if (p[0] == '\\' && vim_iswhite(p[1]))
100 ! if (p[0] == '\\' && p[1] == '\\')
105 ! else if (p[0] == '\\' && vim_iswhite(p[1]))
114 ! if (p[0] == '\\' && vim_iswhite(p[1]))
122 ! if (p[0] == '\\' && p[1] == '\\')
128 ! else if (p[0] == '\\' && vim_iswhite(p[1]))
137 ! case 2: /* Quote and split */
138 /* This is hard, so only do it once, and cache the result */
139 if (*split_buf == NULL)
140 *split_buf = uc_split_args(eap->arg, split_len);
145 ! case 2: /* Quote and split (<f-args>) */
146 /* This is hard, so only do it once, and cache the result */
147 if (*split_buf == NULL)
148 *split_buf = uc_split_args(eap->arg, split_len);
149 *** ../vim-7.0.213/src/version.c Thu Mar 8 14:54:52 2007
150 --- src/version.c Thu Mar 8 18:11:47 2007
154 { /* Add new patch number below this line */
160 Microsoft's definition of a boolean: TRUE, FALSE, MAYBE
161 "Embrace and extend"...?
163 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
164 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
165 \\\ download, build and distribute -- http://www.A-A-P.org ///
166 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///