• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisionc3ba2dcc4cf4b96ddd1e3df9beacd1e11abe7868 (tree)
Zeit2007-03-09 02:12:08
Autorvimboss
Commitervimboss

Log Message

updated for version 7.0-214

Ändern Zusammenfassung

Diff

diff -r c94bbf85eb16 -r c3ba2dcc4cf4 runtime/doc/map.txt
--- a/runtime/doc/map.txt Thu Mar 08 13:49:53 2007 +0000
+++ b/runtime/doc/map.txt Thu Mar 08 17:12:08 2007 +0000
@@ -1,4 +1,4 @@
1-*map.txt* For Vim version 7.0. Last change: 2006 May 03
1+*map.txt* For Vim version 7.0. Last change: 2007 Mar 08
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1303,12 +1303,28 @@
13031303 <q-args>) then the value is quoted in such a way as to make it a valid value
13041304 for use in an expression. This uses the argument as one single value.
13051305 When there is no argument <q-args> is an empty string.
1306-
1306+ *<f-args>*
13071307 To allow commands to pass their arguments on to a user-defined function, there
13081308 is a special form <f-args> ("function args"). This splits the command
13091309 arguments at spaces and Tabs, quotes each argument individually, and the
13101310 <f-args> sequence is replaced by the comma-separated list of quoted arguments.
13111311 See the Mycmd example below. If no arguments are given <f-args> is removed.
1312+ To embed whitespace into an argument of <f-args>, prepend a backslash.
1313+<f-args> replaces every pair of backslashes (\\) with one backslash. A
1314+backslash followed by a character other than white space or a backslash
1315+remains unmodified. Overview:
1316+
1317+ command <f-args> ~
1318+ XX ab 'ab'
1319+ XX a\b 'a\b'
1320+ XX a\ b 'a b'
1321+ XX a\ b 'a ', 'b'
1322+ XX a\\b 'a\b'
1323+ XX a\\ b 'a\', 'b'
1324+ XX a\\\b 'a\\b'
1325+ XX a\\\ b 'a\ b'
1326+ XX a\\\\b 'a\\b'
1327+ XX a\\\\ b 'a\\', 'b'
13121328
13131329 Examples >
13141330
diff -r c94bbf85eb16 -r c3ba2dcc4cf4 src/ex_docmd.c
--- a/src/ex_docmd.c Thu Mar 08 13:49:53 2007 +0000
+++ b/src/ex_docmd.c Thu Mar 08 17:12:08 2007 +0000
@@ -5551,6 +5551,9 @@
55515551 mch_memmove(cmd, cmd + 1, (gap->ga_len - i) * sizeof(ucmd_T));
55525552 }
55535553
5554+/*
5555+ * split and quote args for <f-args>
5556+ */
55545557 static char_u *
55555558 uc_split_args(arg, lenp)
55565559 char_u *arg;
@@ -5567,7 +5570,12 @@
55675570
55685571 while (*p)
55695572 {
5570- if (p[0] == '\\' && vim_iswhite(p[1]))
5573+ if (p[0] == '\\' && p[1] == '\\')
5574+ {
5575+ len += 2;
5576+ p += 2;
5577+ }
5578+ else if (p[0] == '\\' && vim_iswhite(p[1]))
55715579 {
55725580 len += 1;
55735581 p += 2;
@@ -5603,7 +5611,13 @@
56035611 *q++ = '"';
56045612 while (*p)
56055613 {
5606- if (p[0] == '\\' && vim_iswhite(p[1]))
5614+ if (p[0] == '\\' && p[1] == '\\')
5615+ {
5616+ *q++ = '\\';
5617+ *q++ = '\\';
5618+ p += 2;
5619+ }
5620+ else if (p[0] == '\\' && vim_iswhite(p[1]))
56075621 {
56085622 *q++ = p[1];
56095623 p += 2;
@@ -5735,7 +5749,7 @@
57355749 }
57365750
57375751 break;
5738- case 2: /* Quote and split */
5752+ case 2: /* Quote and split (<f-args>) */
57395753 /* This is hard, so only do it once, and cache the result */
57405754 if (*split_buf == NULL)
57415755 *split_buf = uc_split_args(eap->arg, split_len);
diff -r c94bbf85eb16 -r c3ba2dcc4cf4 src/version.c
--- a/src/version.c Thu Mar 08 13:49:53 2007 +0000
+++ b/src/version.c Thu Mar 08 17:12:08 2007 +0000
@@ -667,6 +667,8 @@
667667 static int included_patches[] =
668668 { /* Add new patch number below this line */
669669 /**/
670+ 214,
671+/**/
670672 213,
671673 /**/
672674 212,
Show on old repository browser