astepano / rpms / vim

Forked from rpms/vim 6 years ago
Clone
8a08008
To: vim-dev@vim.org
8a08008
Subject: patch 7.1.081
8a08008
Fcc: outbox
8a08008
From: Bram Moolenaar <Bram@moolenaar.net>
8a08008
Mime-Version: 1.0
8a08008
Content-Type: text/plain; charset=ISO-8859-1
8a08008
Content-Transfer-Encoding: 8bit
8a08008
------------
8a08008
8a08008
Patch 7.1.081
8a08008
Problem:    Command line completion for a shell command: "cat </tmp/file<Tab>"
8a08008
	    doesn't work.
8a08008
Solution:   Start the file name at any character that can't be in a file name.
8a08008
	    (Martin Toft)
8a08008
Files:	    src/ex_docmd.c
8a08008
8a08008
8a08008
*** ../vim-7.1.080/src/ex_docmd.c	Tue Aug 14 22:54:00 2007
8a08008
--- src/ex_docmd.c	Sat Aug 18 14:58:53 2007
8a08008
***************
8a08008
*** 3281,3319 ****
8a08008
  
8a08008
      if (ea.argt & XFILE)
8a08008
      {
8a08008
! 	int in_quote = FALSE;
8a08008
! 	char_u *bow = NULL;	/* Beginning of word */
8a08008
  
8a08008
  	/*
8a08008
  	 * Allow spaces within back-quotes to count as part of the argument
8a08008
  	 * being expanded.
8a08008
  	 */
8a08008
  	xp->xp_pattern = skipwhite(arg);
8a08008
! 	for (p = xp->xp_pattern; *p; )
8a08008
  	{
8a08008
! 	    if (*p == '\\' && p[1] != NUL)
8a08008
  		++p;
8a08008
  #ifdef SPACE_IN_FILENAME
8a08008
! 	    else if (vim_iswhite(*p) && (!(ea.argt & NOSPC) || usefilter))
8a08008
  #else
8a08008
! 	    else if (vim_iswhite(*p))
8a08008
  #endif
8a08008
  	    {
8a08008
! 		p = skipwhite(p);
8a08008
  		if (in_quote)
8a08008
  		    bow = p;
8a08008
  		else
8a08008
  		    xp->xp_pattern = p;
8a08008
! 		--p;
8a08008
! 	    }
8a08008
! 	    else if (*p == '`')
8a08008
! 	    {
8a08008
! 		if (!in_quote)
8a08008
! 		{
8a08008
! 		    xp->xp_pattern = p;
8a08008
! 		    bow = p + 1;
8a08008
! 		}
8a08008
! 		in_quote = !in_quote;
8a08008
  	    }
8a08008
  	    mb_ptr_adv(p);
8a08008
  	}
8a08008
--- 3281,3344 ----
8a08008
  
8a08008
      if (ea.argt & XFILE)
8a08008
      {
8a08008
! 	int	c;
8a08008
! 	int	in_quote = FALSE;
8a08008
! 	char_u	*bow = NULL;	/* Beginning of word */
8a08008
  
8a08008
  	/*
8a08008
  	 * Allow spaces within back-quotes to count as part of the argument
8a08008
  	 * being expanded.
8a08008
  	 */
8a08008
  	xp->xp_pattern = skipwhite(arg);
8a08008
! 	p = xp->xp_pattern;
8a08008
! 	while (*p != NUL)
8a08008
  	{
8a08008
! #ifdef FEAT_MBYTE
8a08008
! 	    if (has_mbyte)
8a08008
! 		c = mb_ptr2char(p);
8a08008
! 	    else
8a08008
! #endif
8a08008
! 		c = *p;
8a08008
! 	    if (c == '\\' && p[1] != NUL)
8a08008
  		++p;
8a08008
+ 	    else if (c == '`')
8a08008
+ 	    {
8a08008
+ 		if (!in_quote)
8a08008
+ 		{
8a08008
+ 		    xp->xp_pattern = p;
8a08008
+ 		    bow = p + 1;
8a08008
+ 		}
8a08008
+ 		in_quote = !in_quote;
8a08008
+ 	    }
8a08008
  #ifdef SPACE_IN_FILENAME
8a08008
! 	    else if (!vim_isfilec(c) && (!(ea.argt & NOSPC) || usefilter))
8a08008
  #else
8a08008
! 	    else if (!vim_isfilec(c))
8a08008
  #endif
8a08008
  	    {
8a08008
! 		while (*p != NUL)
8a08008
! 		{
8a08008
! #ifdef FEAT_MBYTE
8a08008
! 		    if (has_mbyte)
8a08008
! 			c = mb_ptr2char(p);
8a08008
! 		    else
8a08008
! #endif
8a08008
! 			c = *p;
8a08008
! 		    if (c == '`' || vim_isfilec(c))
8a08008
! 			break;
8a08008
! #ifdef FEAT_MBYTE
8a08008
! 		    if (has_mbyte)
8a08008
! 			len = (*mb_ptr2len)(p);
8a08008
! 		    else
8a08008
! #endif
8a08008
! 			len = 1;
8a08008
! 		    mb_ptr_adv(p);
8a08008
! 		}
8a08008
  		if (in_quote)
8a08008
  		    bow = p;
8a08008
  		else
8a08008
  		    xp->xp_pattern = p;
8a08008
! 		p -= len;
8a08008
  	    }
8a08008
  	    mb_ptr_adv(p);
8a08008
  	}
8a08008
*** ../vim-7.1.080/src/version.c	Sat Aug 18 16:59:43 2007
8a08008
--- src/version.c	Sat Aug 18 17:45:54 2007
8a08008
***************
8a08008
*** 668,669 ****
8a08008
--- 668,671 ----
8a08008
  {   /* Add new patch number below this line */
8a08008
+ /**/
8a08008
+     81,
8a08008
  /**/
8a08008
8a08008
-- 
8a08008
hundred-and-one symptoms of being an internet addict:
8a08008
194. Your business cards contain your e-mail and home page address.
8a08008
8a08008
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8a08008
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8a08008
\\\        download, build and distribute -- http://www.A-A-P.org        ///
8a08008
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///