Blame SOURCES/7.4.601

d6ba96
To: vim_dev@googlegroups.com
d6ba96
Subject: Patch 7.4.601
d6ba96
Fcc: outbox
d6ba96
From: Bram Moolenaar <Bram@moolenaar.net>
d6ba96
Mime-Version: 1.0
d6ba96
Content-Type: text/plain; charset=UTF-8
d6ba96
Content-Transfer-Encoding: 8bit
d6ba96
------------
d6ba96
d6ba96
Patch 7.4.601
d6ba96
Problem:    It is not possible to have feedkeys() insert characters.
d6ba96
Solution:   Add the 'i' flag.
d6ba96
Files:	    src/eval.c, runtime/doc/eval.txt
d6ba96
d6ba96
d6ba96
*** ../vim-7.4.600/src/eval.c	2015-01-27 13:49:27.883049396 +0100
d6ba96
--- src/eval.c	2015-01-27 15:13:01.928187370 +0100
d6ba96
***************
d6ba96
*** 10500,10505 ****
d6ba96
--- 10500,10506 ----
d6ba96
      typval_T    *rettv UNUSED;
d6ba96
  {
d6ba96
      int		remap = TRUE;
d6ba96
+     int		insert = FALSE;
d6ba96
      char_u	*keys, *flags;
d6ba96
      char_u	nbuf[NUMBUFLEN];
d6ba96
      int		typed = FALSE;
d6ba96
***************
d6ba96
*** 10524,10529 ****
d6ba96
--- 10525,10531 ----
d6ba96
  		    case 'n': remap = FALSE; break;
d6ba96
  		    case 'm': remap = TRUE; break;
d6ba96
  		    case 't': typed = TRUE; break;
d6ba96
+ 		    case 'i': insert = TRUE; break;
d6ba96
  		}
d6ba96
  	    }
d6ba96
  	}
d6ba96
***************
d6ba96
*** 10534,10540 ****
d6ba96
  	if (keys_esc != NULL)
d6ba96
  	{
d6ba96
  	    ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE),
d6ba96
! 					       typebuf.tb_len, !typed, FALSE);
d6ba96
  	    vim_free(keys_esc);
d6ba96
  	    if (vgetc_busy)
d6ba96
  		typebuf_was_filled = TRUE;
d6ba96
--- 10536,10542 ----
d6ba96
  	if (keys_esc != NULL)
d6ba96
  	{
d6ba96
  	    ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE),
d6ba96
! 				  insert ? 0 : typebuf.tb_len, !typed, FALSE);
d6ba96
  	    vim_free(keys_esc);
d6ba96
  	    if (vgetc_busy)
d6ba96
  		typebuf_was_filled = TRUE;
d6ba96
*** ../vim-7.4.600/runtime/doc/eval.txt	2014-11-27 19:14:45.080940970 +0100
d6ba96
--- runtime/doc/eval.txt	2015-01-27 15:12:52.908285780 +0100
d6ba96
***************
d6ba96
*** 2957,2965 ****
d6ba96
  
d6ba96
  feedkeys({string} [, {mode}])				*feedkeys()*
d6ba96
  		Characters in {string} are queued for processing as if they
d6ba96
! 		come from a mapping or were typed by the user.	They are added
d6ba96
! 		to the end of the typeahead buffer, thus if a mapping is still
d6ba96
! 		being executed these characters come after them.
d6ba96
  		The function does not wait for processing of keys contained in
d6ba96
  		{string}.
d6ba96
  		To include special keys into {string}, use double-quotes
d6ba96
--- 2965,2976 ----
d6ba96
  
d6ba96
  feedkeys({string} [, {mode}])				*feedkeys()*
d6ba96
  		Characters in {string} are queued for processing as if they
d6ba96
! 		come from a mapping or were typed by the user.
d6ba96
! 		By default the string is added to the end of the typeahead
d6ba96
! 		buffer, thus if a mapping is still being executed the
d6ba96
! 		characters come after them.  Use the 'i' flag to insert before
d6ba96
! 		other characters, they will be executed next, before any
d6ba96
! 		characters from a mapping.
d6ba96
  		The function does not wait for processing of keys contained in
d6ba96
  		{string}.
d6ba96
  		To include special keys into {string}, use double-quotes
d6ba96
***************
d6ba96
*** 2973,2978 ****
d6ba96
--- 2984,2990 ----
d6ba96
  		't'	Handle keys as if typed; otherwise they are handled as
d6ba96
  			if coming from a mapping.  This matters for undo,
d6ba96
  			opening folds, etc.
d6ba96
+ 		'i'	Insert the string instead of appending (see above).
d6ba96
  		Return value is always 0.
d6ba96
  
d6ba96
  filereadable({file})					*filereadable()*
d6ba96
*** ../vim-7.4.600/src/version.c	2015-01-27 14:54:07.944583588 +0100
d6ba96
--- src/version.c	2015-01-27 15:15:35.290514092 +0100
d6ba96
***************
d6ba96
*** 743,744 ****
d6ba96
--- 743,746 ----
d6ba96
  {   /* Add new patch number below this line */
d6ba96
+ /**/
d6ba96
+     601,
d6ba96
  /**/
d6ba96
d6ba96
-- 
d6ba96
hundred-and-one symptoms of being an internet addict:
d6ba96
127. You bring your laptop and cellular phone to church.
d6ba96
d6ba96
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
d6ba96
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
d6ba96
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
d6ba96
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///