Karsten Hopp 925d28
To: vim-dev@vim.org
Karsten Hopp 925d28
Subject: Patch 7.2.270
Karsten Hopp 925d28
Fcc: outbox
Karsten Hopp 925d28
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 925d28
Mime-Version: 1.0
Karsten Hopp 925d28
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 925d28
Content-Transfer-Encoding: 8bit
Karsten Hopp 925d28
------------
Karsten Hopp 925d28
Karsten Hopp 925d28
Patch 7.2.270
Karsten Hopp 925d28
Problem:    Using ":@c" when the c register contains a CR causes the rest to
Karsten Hopp 925d28
	    be executed later. (Dexter Douglas)
Karsten Hopp 925d28
Solution:   Don't check for typeahead to start with ':', keep executing
Karsten Hopp 925d28
	    commands until all added typeahead has been used.
Karsten Hopp 925d28
Files:	    src/ex_docmd.c
Karsten Hopp 925d28
Karsten Hopp 925d28
Karsten Hopp 925d28
*** ../vim-7.2.269/src/ex_docmd.c	2009-09-30 13:23:57.000000000 +0200
Karsten Hopp 925d28
--- src/ex_docmd.c	2009-10-28 12:06:54.000000000 +0100
Karsten Hopp 925d28
***************
Karsten Hopp 925d28
*** 8358,8363 ****
Karsten Hopp 925d28
--- 8358,8364 ----
Karsten Hopp 925d28
      exarg_T	*eap;
Karsten Hopp 925d28
  {
Karsten Hopp 925d28
      int		c;
Karsten Hopp 925d28
+     int		prev_len = typebuf.tb_len;
Karsten Hopp 925d28
  
Karsten Hopp 925d28
      curwin->w_cursor.lnum = eap->line2;
Karsten Hopp 925d28
  
Karsten Hopp 925d28
***************
Karsten Hopp 925d28
*** 8383,8393 ****
Karsten Hopp 925d28
  
Karsten Hopp 925d28
  	/*
Karsten Hopp 925d28
  	 * Execute from the typeahead buffer.
Karsten Hopp 925d28
! 	 * Originally this didn't check for the typeahead buffer to be empty,
Karsten Hopp 925d28
! 	 * thus could read more Ex commands from stdin.  It's not clear why,
Karsten Hopp 925d28
! 	 * it is certainly unexpected.
Karsten Hopp 925d28
  	 */
Karsten Hopp 925d28
! 	while ((!stuff_empty() || typebuf.tb_len > 0) && vpeekc() == ':')
Karsten Hopp 925d28
  	    (void)do_cmdline(NULL, getexline, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE);
Karsten Hopp 925d28
  
Karsten Hopp 925d28
  	exec_from_reg = save_efr;
Karsten Hopp 925d28
--- 8384,8393 ----
Karsten Hopp 925d28
  
Karsten Hopp 925d28
  	/*
Karsten Hopp 925d28
  	 * Execute from the typeahead buffer.
Karsten Hopp 925d28
! 	 * Continue until the stuff buffer is empty and all added characters
Karsten Hopp 925d28
! 	 * have been consumed.
Karsten Hopp 925d28
  	 */
Karsten Hopp 925d28
! 	while (!stuff_empty() || typebuf.tb_len > prev_len)
Karsten Hopp 925d28
  	    (void)do_cmdline(NULL, getexline, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE);
Karsten Hopp 925d28
  
Karsten Hopp 925d28
  	exec_from_reg = save_efr;
Karsten Hopp 925d28
*** ../vim-7.2.269/src/version.c	2009-11-03 12:10:39.000000000 +0100
Karsten Hopp 925d28
--- src/version.c	2009-11-03 12:32:47.000000000 +0100
Karsten Hopp 925d28
***************
Karsten Hopp 925d28
*** 678,679 ****
Karsten Hopp 925d28
--- 678,681 ----
Karsten Hopp 925d28
  {   /* Add new patch number below this line */
Karsten Hopp 925d28
+ /**/
Karsten Hopp 925d28
+     270,
Karsten Hopp 925d28
  /**/
Karsten Hopp 925d28
Karsten Hopp 925d28
-- 
Karsten Hopp 925d28
To the optimist, the glass is half full.
Karsten Hopp 925d28
To the pessimist, the glass is half empty.
Karsten Hopp 925d28
To the engineer, the glass is twice as big as it needs to be.
Karsten Hopp 925d28
Karsten Hopp 925d28
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 925d28
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 925d28
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 925d28
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///