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