astepano / rpms / vim

Forked from rpms/vim 6 years ago
Clone
9f6c970
# KH: Modified for runtime update
9f6c970
To: vim-dev@vim.org
9f6c970
Subject: patch 7.0.214
9f6c970
Fcc: outbox
9f6c970
From: Bram Moolenaar <Bram@moolenaar.net>
9f6c970
Mime-Version: 1.0
9f6c970
Content-Type: text/plain; charset=ISO-8859-1
9f6c970
Content-Transfer-Encoding: 8bit
9f6c970
------------
9f6c970
9f6c970
Patch 7.0.214
9f6c970
Problem:    When using <f-args> in a user command it's not possible to have an
9f6c970
	    argument end in '\ '.
9f6c970
Solution:   Change the handling of backslashes. (Yakov Lerner)
9f6c970
Files:	    runtime/doc/map.txt, src/ex_docmd.c
9f6c970
9f6c970
9f6c970
--- vim70/runtime/doc/map.txt.214	2006-09-08 23:26:31.000000000 +0200
9f6c970
+++ runtime/doc/map.txt	2007-03-30 11:54:36.000000000 +0200
9f6c970
@@ -1,4 +1,4 @@
9f6c970
-*map.txt*       For Vim version 7.0.  Last change: 2006 Sep 05
9f6c970
+*map.txt*       For Vim version 7.0.  Last change: 2007 Mar 08
9f6c970
 
9f6c970
 
9f6c970
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
9f6c970
@@ -1312,6 +1312,22 @@
9f6c970
 arguments at spaces and Tabs, quotes each argument individually, and the
9f6c970
 <f-args> sequence is replaced by the comma-separated list of quoted arguments.
9f6c970
 See the Mycmd example below.  If no arguments are given <f-args> is removed.
9f6c970
+    To embed whitespace into an argument of <f-args>, prepend a backslash.
9f6c970
+ <f-args> replaces every pair of backslashes (\\) with one backslash.  A
9f6c970
+ backslash followed by a character other than white space or a backslash
9f6c970
+ remains unmodified.  Overview:
9f6c970
+
9f6c970
+       command            <f-args> ~
9f6c970
+       XX ab              'ab'
9f6c970
+       XX a\b             'a\b'
9f6c970
+       XX a\ b            'a b'
9f6c970
+       XX a\  b           'a ', 'b'
9f6c970
+       XX a\\b            'a\b'
9f6c970
+       XX a\\ b           'a\', 'b'
9f6c970
+       XX a\\\b           'a\\b'
9f6c970
+       XX a\\\ b          'a\ b'
9f6c970
+       XX a\\\\b          'a\\b'
9f6c970
+       XX a\\\\ b         'a\\', 'b'
9f6c970
 
9f6c970
 Examples >
9f6c970
 
9f6c970
*** ../vim-7.0.213/src/ex_docmd.c	Tue Nov 28 21:41:19 2006
9f6c970
--- src/ex_docmd.c	Thu Mar  8 17:49:11 2007
9f6c970
***************
9f6c970
*** 5551,5556 ****
9f6c970
--- 5551,5559 ----
9f6c970
  	mch_memmove(cmd, cmd + 1, (gap->ga_len - i) * sizeof(ucmd_T));
9f6c970
  }
9f6c970
  
9f6c970
+ /*
9f6c970
+  * split and quote args for <f-args>
9f6c970
+  */
9f6c970
      static char_u *
9f6c970
  uc_split_args(arg, lenp)
9f6c970
      char_u *arg;
9f6c970
***************
9f6c970
*** 5567,5573 ****
9f6c970
  
9f6c970
      while (*p)
9f6c970
      {
9f6c970
! 	if (p[0] == '\\' && vim_iswhite(p[1]))
9f6c970
  	{
9f6c970
  	    len += 1;
9f6c970
  	    p += 2;
9f6c970
--- 5570,5581 ----
9f6c970
  
9f6c970
      while (*p)
9f6c970
      {
9f6c970
! 	if (p[0] == '\\' && p[1] == '\\')
9f6c970
! 	{
9f6c970
! 	    len += 2;
9f6c970
! 	    p += 2;
9f6c970
! 	}
9f6c970
! 	else if (p[0] == '\\' && vim_iswhite(p[1]))
9f6c970
  	{
9f6c970
  	    len += 1;
9f6c970
  	    p += 2;
9f6c970
***************
9f6c970
*** 5603,5609 ****
9f6c970
      *q++ = '"';
9f6c970
      while (*p)
9f6c970
      {
9f6c970
! 	if (p[0] == '\\' && vim_iswhite(p[1]))
9f6c970
  	{
9f6c970
  	    *q++ = p[1];
9f6c970
  	    p += 2;
9f6c970
--- 5611,5623 ----
9f6c970
      *q++ = '"';
9f6c970
      while (*p)
9f6c970
      {
9f6c970
! 	if (p[0] == '\\' && p[1] == '\\')
9f6c970
! 	{
9f6c970
! 	    *q++ = '\\';
9f6c970
! 	    *q++ = '\\';
9f6c970
! 	    p += 2;
9f6c970
! 	}
9f6c970
! 	else if (p[0] == '\\' && vim_iswhite(p[1]))
9f6c970
  	{
9f6c970
  	    *q++ = p[1];
9f6c970
  	    p += 2;
9f6c970
***************
9f6c970
*** 5735,5741 ****
9f6c970
  	    }
9f6c970
  
9f6c970
  	    break;
9f6c970
! 	case 2: /* Quote and split */
9f6c970
  	    /* This is hard, so only do it once, and cache the result */
9f6c970
  	    if (*split_buf == NULL)
9f6c970
  		*split_buf = uc_split_args(eap->arg, split_len);
9f6c970
--- 5749,5755 ----
9f6c970
  	    }
9f6c970
  
9f6c970
  	    break;
9f6c970
! 	case 2: /* Quote and split (<f-args>) */
9f6c970
  	    /* This is hard, so only do it once, and cache the result */
9f6c970
  	    if (*split_buf == NULL)
9f6c970
  		*split_buf = uc_split_args(eap->arg, split_len);
9f6c970
*** ../vim-7.0.213/src/version.c	Thu Mar  8 14:54:52 2007
9f6c970
--- src/version.c	Thu Mar  8 18:11:47 2007
9f6c970
***************
9f6c970
*** 668,669 ****
9f6c970
--- 668,671 ----
9f6c970
  {   /* Add new patch number below this line */
9f6c970
+ /**/
9f6c970
+     214,
9f6c970
  /**/
9f6c970
9f6c970
-- 
9f6c970
Microsoft's definition of a boolean: TRUE, FALSE, MAYBE
9f6c970
"Embrace and extend"...?
9f6c970
9f6c970
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
9f6c970
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
9f6c970
\\\        download, build and distribute -- http://www.A-A-P.org        ///
9f6c970
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///