Karsten Hopp 009ecd
To: vim_dev@googlegroups.com
Karsten Hopp 009ecd
Subject: Patch 7.3.736
Karsten Hopp 009ecd
Fcc: outbox
Karsten Hopp 009ecd
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 009ecd
Mime-Version: 1.0
Karsten Hopp 009ecd
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 009ecd
Content-Transfer-Encoding: 8bit
Karsten Hopp 009ecd
------------
Karsten Hopp 009ecd
Karsten Hopp 009ecd
Patch 7.3.736
Karsten Hopp 009ecd
Problem:    File name completion in input() escapes white space. (Frederic
Karsten Hopp 009ecd
	    Hardy)
Karsten Hopp 009ecd
Solution:   Do not escape white space. (Christian Brabandt)
Karsten Hopp 009ecd
Files:	    src/ex_getln.c
Karsten Hopp 009ecd
Karsten Hopp 009ecd
Karsten Hopp 009ecd
*** ../vim-7.3.735/src/ex_getln.c	2012-10-11 04:04:32.000000000 +0200
Karsten Hopp 009ecd
--- src/ex_getln.c	2012-11-28 16:42:12.000000000 +0100
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 102,108 ****
Karsten Hopp 009ecd
  static void	redrawcmdprompt __ARGS((void));
Karsten Hopp 009ecd
  static void	cursorcmd __ARGS((void));
Karsten Hopp 009ecd
  static int	ccheck_abbr __ARGS((int));
Karsten Hopp 009ecd
! static int	nextwild __ARGS((expand_T *xp, int type, int options));
Karsten Hopp 009ecd
  static void	escape_fname __ARGS((char_u **pp));
Karsten Hopp 009ecd
  static int	showmatches __ARGS((expand_T *xp, int wildmenu));
Karsten Hopp 009ecd
  static void	set_expand_context __ARGS((expand_T *xp));
Karsten Hopp 009ecd
--- 102,108 ----
Karsten Hopp 009ecd
  static void	redrawcmdprompt __ARGS((void));
Karsten Hopp 009ecd
  static void	cursorcmd __ARGS((void));
Karsten Hopp 009ecd
  static int	ccheck_abbr __ARGS((int));
Karsten Hopp 009ecd
! static int	nextwild __ARGS((expand_T *xp, int type, int options, int escape));
Karsten Hopp 009ecd
  static void	escape_fname __ARGS((char_u **pp));
Karsten Hopp 009ecd
  static int	showmatches __ARGS((expand_T *xp, int wildmenu));
Karsten Hopp 009ecd
  static void	set_expand_context __ARGS((expand_T *xp));
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 810,818 ****
Karsten Hopp 009ecd
  		    did_wild_list = TRUE;
Karsten Hopp 009ecd
  		}
Karsten Hopp 009ecd
  		if (wim_flags[wim_index] & WIM_LONGEST)
Karsten Hopp 009ecd
! 		    res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP);
Karsten Hopp 009ecd
  		else if (wim_flags[wim_index] & WIM_FULL)
Karsten Hopp 009ecd
! 		    res = nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP);
Karsten Hopp 009ecd
  		else
Karsten Hopp 009ecd
  		    res = OK;	    /* don't insert 'wildchar' now */
Karsten Hopp 009ecd
  	    }
Karsten Hopp 009ecd
--- 810,820 ----
Karsten Hopp 009ecd
  		    did_wild_list = TRUE;
Karsten Hopp 009ecd
  		}
Karsten Hopp 009ecd
  		if (wim_flags[wim_index] & WIM_LONGEST)
Karsten Hopp 009ecd
! 		    res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP,
Karsten Hopp 009ecd
! 							       firstc != '@');
Karsten Hopp 009ecd
  		else if (wim_flags[wim_index] & WIM_FULL)
Karsten Hopp 009ecd
! 		    res = nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP,
Karsten Hopp 009ecd
! 							       firstc != '@');
Karsten Hopp 009ecd
  		else
Karsten Hopp 009ecd
  		    res = OK;	    /* don't insert 'wildchar' now */
Karsten Hopp 009ecd
  	    }
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 823,831 ****
Karsten Hopp 009ecd
  		/* if 'wildmode' first contains "longest", get longest
Karsten Hopp 009ecd
  		 * common part */
Karsten Hopp 009ecd
  		if (wim_flags[0] & WIM_LONGEST)
Karsten Hopp 009ecd
! 		    res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP);
Karsten Hopp 009ecd
  		else
Karsten Hopp 009ecd
! 		    res = nextwild(&xpc, WILD_EXPAND_KEEP, WILD_NO_BEEP);
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
  		/* if interrupted while completing, behave like it failed */
Karsten Hopp 009ecd
  		if (got_int)
Karsten Hopp 009ecd
--- 825,835 ----
Karsten Hopp 009ecd
  		/* if 'wildmode' first contains "longest", get longest
Karsten Hopp 009ecd
  		 * common part */
Karsten Hopp 009ecd
  		if (wim_flags[0] & WIM_LONGEST)
Karsten Hopp 009ecd
! 		    res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP,
Karsten Hopp 009ecd
! 							       firstc != '@');
Karsten Hopp 009ecd
  		else
Karsten Hopp 009ecd
! 		    res = nextwild(&xpc, WILD_EXPAND_KEEP, WILD_NO_BEEP,
Karsten Hopp 009ecd
! 							       firstc != '@');
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
  		/* if interrupted while completing, behave like it failed */
Karsten Hopp 009ecd
  		if (got_int)
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 860,866 ****
Karsten Hopp 009ecd
  			    int p_wmnu_save = p_wmnu;
Karsten Hopp 009ecd
  			    p_wmnu = 0;
Karsten Hopp 009ecd
  #endif
Karsten Hopp 009ecd
! 			    nextwild(&xpc, WILD_PREV, 0); /* remove match */
Karsten Hopp 009ecd
  #ifdef FEAT_WILDMENU
Karsten Hopp 009ecd
  			    p_wmnu = p_wmnu_save;
Karsten Hopp 009ecd
  #endif
Karsten Hopp 009ecd
--- 864,871 ----
Karsten Hopp 009ecd
  			    int p_wmnu_save = p_wmnu;
Karsten Hopp 009ecd
  			    p_wmnu = 0;
Karsten Hopp 009ecd
  #endif
Karsten Hopp 009ecd
! 			    /* remove match */
Karsten Hopp 009ecd
! 			    nextwild(&xpc, WILD_PREV, 0, firstc != '@');
Karsten Hopp 009ecd
  #ifdef FEAT_WILDMENU
Karsten Hopp 009ecd
  			    p_wmnu = p_wmnu_save;
Karsten Hopp 009ecd
  #endif
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 874,882 ****
Karsten Hopp 009ecd
  			redrawcmd();
Karsten Hopp 009ecd
  			did_wild_list = TRUE;
Karsten Hopp 009ecd
  			if (wim_flags[wim_index] & WIM_LONGEST)
Karsten Hopp 009ecd
! 			    nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP);
Karsten Hopp 009ecd
  			else if (wim_flags[wim_index] & WIM_FULL)
Karsten Hopp 009ecd
! 			    nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP);
Karsten Hopp 009ecd
  		    }
Karsten Hopp 009ecd
  		    else
Karsten Hopp 009ecd
  			vim_beep();
Karsten Hopp 009ecd
--- 879,889 ----
Karsten Hopp 009ecd
  			redrawcmd();
Karsten Hopp 009ecd
  			did_wild_list = TRUE;
Karsten Hopp 009ecd
  			if (wim_flags[wim_index] & WIM_LONGEST)
Karsten Hopp 009ecd
! 			    nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP,
Karsten Hopp 009ecd
! 							       firstc != '@');
Karsten Hopp 009ecd
  			else if (wim_flags[wim_index] & WIM_FULL)
Karsten Hopp 009ecd
! 			    nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP,
Karsten Hopp 009ecd
! 							       firstc != '@');
Karsten Hopp 009ecd
  		    }
Karsten Hopp 009ecd
  		    else
Karsten Hopp 009ecd
  			vim_beep();
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 899,907 ****
Karsten Hopp 009ecd
  	/* <S-Tab> goes to last match, in a clumsy way */
Karsten Hopp 009ecd
  	if (c == K_S_TAB && KeyTyped)
Karsten Hopp 009ecd
  	{
Karsten Hopp 009ecd
! 	    if (nextwild(&xpc, WILD_EXPAND_KEEP, 0) == OK
Karsten Hopp 009ecd
! 		    && nextwild(&xpc, WILD_PREV, 0) == OK
Karsten Hopp 009ecd
! 		    && nextwild(&xpc, WILD_PREV, 0) == OK)
Karsten Hopp 009ecd
  		goto cmdline_changed;
Karsten Hopp 009ecd
  	}
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
--- 906,914 ----
Karsten Hopp 009ecd
  	/* <S-Tab> goes to last match, in a clumsy way */
Karsten Hopp 009ecd
  	if (c == K_S_TAB && KeyTyped)
Karsten Hopp 009ecd
  	{
Karsten Hopp 009ecd
! 	    if (nextwild(&xpc, WILD_EXPAND_KEEP, 0, firstc != '@') == OK
Karsten Hopp 009ecd
! 		    && nextwild(&xpc, WILD_PREV, 0, firstc != '@') == OK
Karsten Hopp 009ecd
! 		    && nextwild(&xpc, WILD_PREV, 0, firstc != '@') == OK)
Karsten Hopp 009ecd
  		goto cmdline_changed;
Karsten Hopp 009ecd
  	}
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 1418,1424 ****
Karsten Hopp 009ecd
  		goto cmdline_not_changed;
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
  	case Ctrl_A:	    /* all matches */
Karsten Hopp 009ecd
! 		if (nextwild(&xpc, WILD_ALL, 0) == FAIL)
Karsten Hopp 009ecd
  		    break;
Karsten Hopp 009ecd
  		goto cmdline_changed;
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
--- 1425,1431 ----
Karsten Hopp 009ecd
  		goto cmdline_not_changed;
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
  	case Ctrl_A:	    /* all matches */
Karsten Hopp 009ecd
! 		if (nextwild(&xpc, WILD_ALL, 0, firstc != '@') == FAIL)
Karsten Hopp 009ecd
  		    break;
Karsten Hopp 009ecd
  		goto cmdline_changed;
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 1454,1460 ****
Karsten Hopp 009ecd
  #endif
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
  		/* completion: longest common part */
Karsten Hopp 009ecd
! 		if (nextwild(&xpc, WILD_LONGEST, 0) == FAIL)
Karsten Hopp 009ecd
  		    break;
Karsten Hopp 009ecd
  		goto cmdline_changed;
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
--- 1461,1467 ----
Karsten Hopp 009ecd
  #endif
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
  		/* completion: longest common part */
Karsten Hopp 009ecd
! 		if (nextwild(&xpc, WILD_LONGEST, 0, firstc != '@') == FAIL)
Karsten Hopp 009ecd
  		    break;
Karsten Hopp 009ecd
  		goto cmdline_changed;
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 1462,1469 ****
Karsten Hopp 009ecd
  	case Ctrl_P:	    /* previous match */
Karsten Hopp 009ecd
  		if (xpc.xp_numfiles > 0)
Karsten Hopp 009ecd
  		{
Karsten Hopp 009ecd
! 		    if (nextwild(&xpc, (c == Ctrl_P) ? WILD_PREV : WILD_NEXT, 0)
Karsten Hopp 009ecd
! 								      == FAIL)
Karsten Hopp 009ecd
  			break;
Karsten Hopp 009ecd
  		    goto cmdline_changed;
Karsten Hopp 009ecd
  		}
Karsten Hopp 009ecd
--- 1469,1476 ----
Karsten Hopp 009ecd
  	case Ctrl_P:	    /* previous match */
Karsten Hopp 009ecd
  		if (xpc.xp_numfiles > 0)
Karsten Hopp 009ecd
  		{
Karsten Hopp 009ecd
! 		    if (nextwild(&xpc, (c == Ctrl_P) ? WILD_PREV : WILD_NEXT,
Karsten Hopp 009ecd
! 						    0, firstc != '@') == FAIL)
Karsten Hopp 009ecd
  			break;
Karsten Hopp 009ecd
  		    goto cmdline_changed;
Karsten Hopp 009ecd
  		}
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 3338,3347 ****
Karsten Hopp 009ecd
   * normal character (instead of being expanded).  This allows :s/^I^D etc.
Karsten Hopp 009ecd
   */
Karsten Hopp 009ecd
      static int
Karsten Hopp 009ecd
! nextwild(xp, type, options)
Karsten Hopp 009ecd
      expand_T	*xp;
Karsten Hopp 009ecd
      int		type;
Karsten Hopp 009ecd
      int		options;	/* extra options for ExpandOne() */
Karsten Hopp 009ecd
  {
Karsten Hopp 009ecd
      int		i, j;
Karsten Hopp 009ecd
      char_u	*p1;
Karsten Hopp 009ecd
--- 3345,3355 ----
Karsten Hopp 009ecd
   * normal character (instead of being expanded).  This allows :s/^I^D etc.
Karsten Hopp 009ecd
   */
Karsten Hopp 009ecd
      static int
Karsten Hopp 009ecd
! nextwild(xp, type, options, escape)
Karsten Hopp 009ecd
      expand_T	*xp;
Karsten Hopp 009ecd
      int		type;
Karsten Hopp 009ecd
      int		options;	/* extra options for ExpandOne() */
Karsten Hopp 009ecd
+     int		escape;		/* if TRUE, escape the returned matches */
Karsten Hopp 009ecd
  {
Karsten Hopp 009ecd
      int		i, j;
Karsten Hopp 009ecd
      char_u	*p1;
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 3390,3396 ****
Karsten Hopp 009ecd
  	else
Karsten Hopp 009ecd
  	{
Karsten Hopp 009ecd
  	    int use_options = options |
Karsten Hopp 009ecd
! 		    WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE;
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
  	    if (p_wic)
Karsten Hopp 009ecd
  		use_options += WILD_ICASE;
Karsten Hopp 009ecd
--- 3398,3406 ----
Karsten Hopp 009ecd
  	else
Karsten Hopp 009ecd
  	{
Karsten Hopp 009ecd
  	    int use_options = options |
Karsten Hopp 009ecd
! 		    WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT;
Karsten Hopp 009ecd
! 	    if (escape)
Karsten Hopp 009ecd
! 		use_options |= WILD_ESCAPE;
Karsten Hopp 009ecd
  
Karsten Hopp 009ecd
  	    if (p_wic)
Karsten Hopp 009ecd
  		use_options += WILD_ICASE;
Karsten Hopp 009ecd
*** ../vim-7.3.735/src/version.c	2012-11-28 16:18:26.000000000 +0100
Karsten Hopp 009ecd
--- src/version.c	2012-11-28 16:30:45.000000000 +0100
Karsten Hopp 009ecd
***************
Karsten Hopp 009ecd
*** 727,728 ****
Karsten Hopp 009ecd
--- 727,730 ----
Karsten Hopp 009ecd
  {   /* Add new patch number below this line */
Karsten Hopp 009ecd
+ /**/
Karsten Hopp 009ecd
+     736,
Karsten Hopp 009ecd
  /**/
Karsten Hopp 009ecd
Karsten Hopp 009ecd
-- 
Karsten Hopp 009ecd
From "know your smileys":
Karsten Hopp 009ecd
 ;-0	Can't find shift key
Karsten Hopp 009ecd
 ,-9	Kann Umschalttaste nicht finden
Karsten Hopp 009ecd
Karsten Hopp 009ecd
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 009ecd
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 009ecd
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 009ecd
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///