Blob Blame History Raw
To: vim-dev@vim.org
Subject: Patch 7.2.346
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.346
Problem:    Repeating a command with @: causes a mapping to be applied twice.
Solution:   Do not remap characters inserted in the typeahead buffer. (Kana
	    Natsuno)
Files:	    src/ops.c


*** ../vim-7.2.345/src/ops.c	2010-01-19 14:59:14.000000000 +0100
--- src/ops.c	2010-01-19 13:04:46.000000000 +0100
***************
*** 1301,1310 ****
      }
  }
  
      static int
  put_in_typebuf(s, esc, colon, silent)
      char_u	*s;
!     int		esc;	    /* Escape CSI characters */
      int		colon;	    /* add ':' before the line */
      int		silent;
  {
--- 1301,1316 ----
      }
  }
  
+ /*
+  * Insert register contents "s" into the typeahead buffer, so that it will be
+  * executed again.
+  * When "esc" is TRUE it is to be taken literally: Escape CSI characters and
+  * no remapping.
+  */
      static int
  put_in_typebuf(s, esc, colon, silent)
      char_u	*s;
!     int		esc;
      int		colon;	    /* add ':' before the line */
      int		silent;
  {
***************
*** 1312,1318 ****
  
      put_reedit_in_typebuf(silent);
      if (colon)
! 	retval = ins_typebuf((char_u *)"\n", REMAP_YES, 0, TRUE, silent);
      if (retval == OK)
      {
  	char_u	*p;
--- 1318,1324 ----
  
      put_reedit_in_typebuf(silent);
      if (colon)
! 	retval = ins_typebuf((char_u *)"\n", REMAP_NONE, 0, TRUE, silent);
      if (retval == OK)
      {
  	char_u	*p;
***************
*** 1324,1335 ****
  	if (p == NULL)
  	    retval = FAIL;
  	else
! 	    retval = ins_typebuf(p, REMAP_YES, 0, TRUE, silent);
  	if (esc)
  	    vim_free(p);
      }
      if (colon && retval == OK)
! 	retval = ins_typebuf((char_u *)":", REMAP_YES, 0, TRUE, silent);
      return retval;
  }
  
--- 1330,1342 ----
  	if (p == NULL)
  	    retval = FAIL;
  	else
! 	    retval = ins_typebuf(p, esc ? REMAP_NONE : REMAP_YES,
! 							     0, TRUE, silent);
  	if (esc)
  	    vim_free(p);
      }
      if (colon && retval == OK)
! 	retval = ins_typebuf((char_u *)":", REMAP_NONE, 0, TRUE, silent);
      return retval;
  }
  
*** ../vim-7.2.345/src/version.c	2010-01-27 15:57:17.000000000 +0100
--- src/version.c	2010-01-27 16:25:55.000000000 +0100
***************
*** 683,684 ****
--- 683,686 ----
  {   /* Add new patch number below this line */
+ /**/
+     346,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
155. You forget to eat because you're too busy surfing the net.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///