changeset 11260:a7b7b21071c6 v8.0.0516

patch 8.0.0516: a large count on a normal command causes trouble commit https://github.com/vim/vim/commit/b1e04fca3704e272a30afbe062498819eaacd4f9 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 29 13:08:35 2017 +0200 patch 8.0.0516: a large count on a normal command causes trouble Problem: A large count on a normal command causes trouble. (Dominique Pelle) Solution: Make "opcount" long.
author Christian Brabandt <cb@256bit.org>
date Wed, 29 Mar 2017 13:15:05 +0200
parents e317d9784d4f
children afa323d6b143
files src/globals.h src/testdir/test_normal.vim src/version.c
diffstat 3 files changed, 30 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/globals.h
+++ b/src/globals.h
@@ -932,10 +932,10 @@ EXTERN int	State INIT(= NORMAL);	/* This
 					 * command interpreter. */
 
 EXTERN int	finish_op INIT(= FALSE);/* TRUE while an operator is pending */
-EXTERN int	opcount INIT(= 0);	/* count for pending operator */
+EXTERN long	opcount INIT(= 0);	/* count for pending operator */
 
 /*
- * ex mode (Q) state
+ * Ex mode (Q) state
  */
 EXTERN int exmode_active INIT(= 0);	/* zero, EXMODE_NORMAL or EXMODE_VIM */
 EXTERN int ex_no_reprint INIT(= FALSE); /* no need to print after z or p */
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -2259,26 +2259,34 @@ func! Test_normal53_digraph()
   bw!
 endfunc
 
-func! Test_normal54_Ctrl_bsl()
-	new
-	call setline(1, 'abcdefghijklmn')
-	exe "norm! df\<c-\>\<c-n>"
-	call assert_equal(['abcdefghijklmn'], getline(1,'$'))
-	exe "norm! df\<c-\>\<c-g>"
-	call assert_equal(['abcdefghijklmn'], getline(1,'$'))
-	exe "norm! df\<c-\>m"
-	call assert_equal(['abcdefghijklmn'], getline(1,'$'))
+func Test_normal54_Ctrl_bsl()
+  new
+  call setline(1, 'abcdefghijklmn')
+  exe "norm! df\<c-\>\<c-n>"
+  call assert_equal(['abcdefghijklmn'], getline(1,'$'))
+  exe "norm! df\<c-\>\<c-g>"
+  call assert_equal(['abcdefghijklmn'], getline(1,'$'))
+  exe "norm! df\<c-\>m"
+  call assert_equal(['abcdefghijklmn'], getline(1,'$'))
   if !has("multi_byte")
     return
   endif
-	call setline(2, 'abcdefghijklmnāf')
-	norm! 2gg0
-	exe "norm! df\<Char-0x101>"
-	call assert_equal(['abcdefghijklmn', 'f'], getline(1,'$'))
-	norm! 1gg0
-	exe "norm! df\<esc>"
-	call assert_equal(['abcdefghijklmn', 'f'], getline(1,'$'))
+  call setline(2, 'abcdefghijklmnāf')
+  norm! 2gg0
+  exe "norm! df\<Char-0x101>"
+  call assert_equal(['abcdefghijklmn', 'f'], getline(1,'$'))
+  norm! 1gg0
+  exe "norm! df\<esc>"
+  call assert_equal(['abcdefghijklmn', 'f'], getline(1,'$'))
 
-	" clean up
-	bw!
+  " clean up
+  bw!
 endfunc
+
+func Test_normal_large_count()
+  " This may fail with 32bit long, how do we detect that?
+  new
+  normal o
+  normal 6666666666dL
+  bwipe!
+endfunc
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    516,
+/**/
     515,
 /**/
     514,