99b86a7
To: vim-dev@vim.org
99b86a7
Subject: Patch 7.1.140
99b86a7
Fcc: outbox
99b86a7
From: Bram Moolenaar <Bram@moolenaar.net>
99b86a7
Mime-Version: 1.0
99b86a7
Content-Type: text/plain; charset=ISO-8859-1
99b86a7
Content-Transfer-Encoding: 8bit
99b86a7
------------
99b86a7
99b86a7
Patch 7.1.140
99b86a7
Problem:    v:count is set only after typing a non-digit, that makes it
99b86a7
	    difficult to make a nice mapping.
99b86a7
Solution:   Set v:count while still typing the count.
99b86a7
Files:	    src/normal.c
99b86a7
99b86a7
99b86a7
*** ../vim-7.1.139/src/normal.c	Thu Sep 13 18:25:08 2007
99b86a7
--- src/normal.c	Sun Oct 14 17:15:36 2007
99b86a7
***************
99b86a7
*** 690,695 ****
99b86a7
--- 690,702 ----
99b86a7
  		ca.count0 = ca.count0 * 10 + (c - '0');
99b86a7
  	    if (ca.count0 < 0)	    /* got too large! */
99b86a7
  		ca.count0 = 999999999L;
99b86a7
+ #ifdef FEAT_EVAL
99b86a7
+ 	    /* Set v:count here, when called from main() and not a stuffed
99b86a7
+ 	     * command, so that v:count can be used in an expression mapping
99b86a7
+ 	     * right after the count. */
99b86a7
+ 	    if (toplevel && stuff_empty())
99b86a7
+ 		set_vcount(ca.count0, ca.count0 == 0 ? 1 : ca.count0);
99b86a7
+ #endif
99b86a7
  	    if (ctrl_w)
99b86a7
  	    {
99b86a7
  		++no_mapping;
99b86a7
*** ../vim-7.1.139/src/version.c	Sun Oct 14 15:32:10 2007
99b86a7
--- src/version.c	Sun Oct 14 17:13:15 2007
99b86a7
***************
99b86a7
*** 668,669 ****
99b86a7
--- 668,671 ----
99b86a7
  {   /* Add new patch number below this line */
99b86a7
+ /**/
99b86a7
+     140,
99b86a7
  /**/
99b86a7
99b86a7
-- 
99b86a7
How To Keep A Healthy Level Of Insanity:
99b86a7
11. Specify that your drive-through order is "to go".
99b86a7
99b86a7
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
99b86a7
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
99b86a7
\\\        download, build and distribute -- http://www.A-A-P.org        ///
99b86a7
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///