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