]> granicus.if.org Git - vim/commitdiff
patch 8.2.1211: removed more than dead code v8.2.1211
authorBram Moolenaar <Bram@vim.org>
Tue, 14 Jul 2020 19:22:30 +0000 (21:22 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 14 Jul 2020 19:22:30 +0000 (21:22 +0200)
Problem:    Removed more than dead code.
Solution:   Put back the decrement.

src/move.c
src/testdir/test_diffmode.vim
src/version.c

index ec1ad38ad7711828ece170877210c6ab99297b2a..767134f56d2004e03950590ba99c811f941d6337 100644 (file)
@@ -2681,6 +2681,7 @@ halfpage(int flag, linenr_T Prenum)
            if (curwin->w_topfill > 0)
            {
                i = 1;
+               --n;
                --curwin->w_topfill;
            }
            else
index a3f6d5867b39d952fd28efd5d58688c7492bb65e..c0c5d0d44e1cbb110b7a8b6ef64e054530d4ee22 100644 (file)
@@ -1130,4 +1130,24 @@ func Test_diff_multilineconceal()
   redraw
 endfunc
 
+func Test_diff_and_scroll()
+  " this was causing an ml_get error
+  set ls=2
+  for i in range(winheight(0) * 2) 
+    call setline(i, i < winheight(0) - 10 ? i : i + 10) 
+  endfor
+  vnew
+  for i in range(winheight(0)*2 + 10) 
+    call setline(i, i < winheight(0) - 10 ? 0 : i) 
+  endfor
+  diffthis
+  wincmd p
+  diffthis
+  execute 'normal ' . winheight(0) . "\<C-d>"
+
+  bwipe!
+  bwipe!
+  set ls&
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index 6be113dcac77b2b177a3ced16dfa26c3200be0a7..95b0857fa4bc357fdc6070e4fefd7e0ad4650a8a 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1211,
 /**/
     1210,
 /**/