a8e0e24
To: vim-dev@vim.org
a8e0e24
Subject: Patch 7.2.346
a8e0e24
Fcc: outbox
a8e0e24
From: Bram Moolenaar <Bram@moolenaar.net>
a8e0e24
Mime-Version: 1.0
a8e0e24
Content-Type: text/plain; charset=UTF-8
a8e0e24
Content-Transfer-Encoding: 8bit
a8e0e24
------------
a8e0e24
a8e0e24
Patch 7.2.346
a8e0e24
Problem:    Repeating a command with @: causes a mapping to be applied twice.
a8e0e24
Solution:   Do not remap characters inserted in the typeahead buffer. (Kana
a8e0e24
	    Natsuno)
a8e0e24
Files:	    src/ops.c
a8e0e24
a8e0e24
a8e0e24
*** ../vim-7.2.345/src/ops.c	2010-01-19 14:59:14.000000000 +0100
a8e0e24
--- src/ops.c	2010-01-19 13:04:46.000000000 +0100
a8e0e24
***************
a8e0e24
*** 1301,1310 ****
a8e0e24
      }
a8e0e24
  }
a8e0e24
  
a8e0e24
      static int
a8e0e24
  put_in_typebuf(s, esc, colon, silent)
a8e0e24
      char_u	*s;
a8e0e24
!     int		esc;	    /* Escape CSI characters */
a8e0e24
      int		colon;	    /* add ':' before the line */
a8e0e24
      int		silent;
a8e0e24
  {
a8e0e24
--- 1301,1316 ----
a8e0e24
      }
a8e0e24
  }
a8e0e24
  
a8e0e24
+ /*
a8e0e24
+  * Insert register contents "s" into the typeahead buffer, so that it will be
a8e0e24
+  * executed again.
a8e0e24
+  * When "esc" is TRUE it is to be taken literally: Escape CSI characters and
a8e0e24
+  * no remapping.
a8e0e24
+  */
a8e0e24
      static int
a8e0e24
  put_in_typebuf(s, esc, colon, silent)
a8e0e24
      char_u	*s;
a8e0e24
!     int		esc;
a8e0e24
      int		colon;	    /* add ':' before the line */
a8e0e24
      int		silent;
a8e0e24
  {
a8e0e24
***************
a8e0e24
*** 1312,1318 ****
a8e0e24
  
a8e0e24
      put_reedit_in_typebuf(silent);
a8e0e24
      if (colon)
a8e0e24
! 	retval = ins_typebuf((char_u *)"\n", REMAP_YES, 0, TRUE, silent);
a8e0e24
      if (retval == OK)
a8e0e24
      {
a8e0e24
  	char_u	*p;
a8e0e24
--- 1318,1324 ----
a8e0e24
  
a8e0e24
      put_reedit_in_typebuf(silent);
a8e0e24
      if (colon)
a8e0e24
! 	retval = ins_typebuf((char_u *)"\n", REMAP_NONE, 0, TRUE, silent);
a8e0e24
      if (retval == OK)
a8e0e24
      {
a8e0e24
  	char_u	*p;
a8e0e24
***************
a8e0e24
*** 1324,1335 ****
a8e0e24
  	if (p == NULL)
a8e0e24
  	    retval = FAIL;
a8e0e24
  	else
a8e0e24
! 	    retval = ins_typebuf(p, REMAP_YES, 0, TRUE, silent);
a8e0e24
  	if (esc)
a8e0e24
  	    vim_free(p);
a8e0e24
      }
a8e0e24
      if (colon && retval == OK)
a8e0e24
! 	retval = ins_typebuf((char_u *)":", REMAP_YES, 0, TRUE, silent);
a8e0e24
      return retval;
a8e0e24
  }
a8e0e24
  
a8e0e24
--- 1330,1342 ----
a8e0e24
  	if (p == NULL)
a8e0e24
  	    retval = FAIL;
a8e0e24
  	else
a8e0e24
! 	    retval = ins_typebuf(p, esc ? REMAP_NONE : REMAP_YES,
a8e0e24
! 							     0, TRUE, silent);
a8e0e24
  	if (esc)
a8e0e24
  	    vim_free(p);
a8e0e24
      }
a8e0e24
      if (colon && retval == OK)
a8e0e24
! 	retval = ins_typebuf((char_u *)":", REMAP_NONE, 0, TRUE, silent);
a8e0e24
      return retval;
a8e0e24
  }
a8e0e24
  
a8e0e24
*** ../vim-7.2.345/src/version.c	2010-01-27 15:57:17.000000000 +0100
a8e0e24
--- src/version.c	2010-01-27 16:25:55.000000000 +0100
a8e0e24
***************
a8e0e24
*** 683,684 ****
a8e0e24
--- 683,686 ----
a8e0e24
  {   /* Add new patch number below this line */
a8e0e24
+ /**/
a8e0e24
+     346,
a8e0e24
  /**/
a8e0e24
a8e0e24
-- 
a8e0e24
hundred-and-one symptoms of being an internet addict:
a8e0e24
155. You forget to eat because you're too busy surfing the net.
a8e0e24
a8e0e24
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
a8e0e24
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
a8e0e24
\\\        download, build and distribute -- http://www.A-A-P.org        ///
a8e0e24
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///