Karsten Hopp 4b72b1
To: vim_dev@googlegroups.com
Karsten Hopp 4b72b1
Subject: Patch 7.3.708
Karsten Hopp 4b72b1
Fcc: outbox
Karsten Hopp 4b72b1
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 4b72b1
Mime-Version: 1.0
Karsten Hopp 4b72b1
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 4b72b1
Content-Transfer-Encoding: 8bit
Karsten Hopp 4b72b1
------------
Karsten Hopp 4b72b1
Karsten Hopp 4b72b1
Patch 7.3.708
Karsten Hopp 4b72b1
Problem:    Filler lines above the first line may be hidden when opening Vim.
Karsten Hopp 4b72b1
Solution:   Change how topfill is computed. (Christian Brabandt)
Karsten Hopp 4b72b1
Files:      src/diff.c, src/testdir/test47.in, src/testdir/test47.ok
Karsten Hopp 4b72b1
Karsten Hopp 4b72b1
Karsten Hopp 4b72b1
*** ../vim-7.3.707/src/diff.c	2012-05-18 18:47:11.000000000 +0200
Karsten Hopp 4b72b1
--- src/diff.c	2012-10-21 22:08:44.000000000 +0200
Karsten Hopp 4b72b1
***************
Karsten Hopp 4b72b1
*** 615,625 ****
Karsten Hopp 4b72b1
  #endif
Karsten Hopp 4b72b1
  	    /* A change may have made filler lines invalid, need to take care
Karsten Hopp 4b72b1
  	     * of that for other windows. */
Karsten Hopp 4b72b1
! 	    if (wp != curwin && wp->w_topfill > 0)
Karsten Hopp 4b72b1
  	    {
Karsten Hopp 4b72b1
- 		n = diff_check(wp, wp->w_topline);
Karsten Hopp 4b72b1
  		if (wp->w_topfill > n)
Karsten Hopp 4b72b1
  		    wp->w_topfill = (n < 0 ? 0 : n);
Karsten Hopp 4b72b1
  	    }
Karsten Hopp 4b72b1
  	}
Karsten Hopp 4b72b1
  }
Karsten Hopp 4b72b1
--- 615,627 ----
Karsten Hopp 4b72b1
  #endif
Karsten Hopp 4b72b1
  	    /* A change may have made filler lines invalid, need to take care
Karsten Hopp 4b72b1
  	     * of that for other windows. */
Karsten Hopp 4b72b1
! 	    n = diff_check(wp, wp->w_topline);
Karsten Hopp 4b72b1
! 	    if ((wp != curwin && wp->w_topfill > 0) || n > 0)
Karsten Hopp 4b72b1
  	    {
Karsten Hopp 4b72b1
  		if (wp->w_topfill > n)
Karsten Hopp 4b72b1
  		    wp->w_topfill = (n < 0 ? 0 : n);
Karsten Hopp 4b72b1
+ 		else if (n > 0 && n > wp->w_topfill)
Karsten Hopp 4b72b1
+ 		    wp->w_topfill = n;
Karsten Hopp 4b72b1
  	    }
Karsten Hopp 4b72b1
  	}
Karsten Hopp 4b72b1
  }
Karsten Hopp 4b72b1
*** ../vim-7.3.707/src/testdir/test47.in	2010-08-15 21:57:29.000000000 +0200
Karsten Hopp 4b72b1
--- src/testdir/test47.in	2012-10-21 22:08:44.000000000 +0200
Karsten Hopp 4b72b1
***************
Karsten Hopp 4b72b1
*** 36,42 ****
Karsten Hopp 4b72b1
  :call append("$", two)
Karsten Hopp 4b72b1
  :call append("$", three)
Karsten Hopp 4b72b1
  :$-2,$w! test.out
Karsten Hopp 4b72b1
! :unlet one two three
Karsten Hopp 4b72b1
  :qa!
Karsten Hopp 4b72b1
  ENDTEST
Karsten Hopp 4b72b1
  
Karsten Hopp 4b72b1
--- 36,57 ----
Karsten Hopp 4b72b1
  :call append("$", two)
Karsten Hopp 4b72b1
  :call append("$", three)
Karsten Hopp 4b72b1
  :$-2,$w! test.out
Karsten Hopp 4b72b1
! :" Test that diffing shows correct filler lines
Karsten Hopp 4b72b1
! :diffoff!
Karsten Hopp 4b72b1
! :windo :bw!
Karsten Hopp 4b72b1
! :enew
Karsten Hopp 4b72b1
! :put =range(4,10)
Karsten Hopp 4b72b1
! :1d _
Karsten Hopp 4b72b1
! :vnew
Karsten Hopp 4b72b1
! :put =range(1,10)
Karsten Hopp 4b72b1
! :1d _
Karsten Hopp 4b72b1
! :windo :diffthis
Karsten Hopp 4b72b1
! :wincmd h
Karsten Hopp 4b72b1
! :let w0=line('w0')
Karsten Hopp 4b72b1
! :enew
Karsten Hopp 4b72b1
! :put =w0
Karsten Hopp 4b72b1
! :.w >> test.out
Karsten Hopp 4b72b1
! :unlet! one two three w0
Karsten Hopp 4b72b1
  :qa!
Karsten Hopp 4b72b1
  ENDTEST
Karsten Hopp 4b72b1
  
Karsten Hopp 4b72b1
*** ../vim-7.3.707/src/testdir/test47.ok	2010-08-15 21:57:29.000000000 +0200
Karsten Hopp 4b72b1
--- src/testdir/test47.ok	2012-10-21 22:08:44.000000000 +0200
Karsten Hopp 4b72b1
***************
Karsten Hopp 4b72b1
*** 1,3 ****
Karsten Hopp 4b72b1
--- 1,4 ----
Karsten Hopp 4b72b1
  2-4-5-6-8-9
Karsten Hopp 4b72b1
  1-2-4-5-8
Karsten Hopp 4b72b1
  2-3-4-5-6-7-8
Karsten Hopp 4b72b1
+ 1
Karsten Hopp 4b72b1
*** ../vim-7.3.707/src/version.c	2012-10-21 21:38:42.000000000 +0200
Karsten Hopp 4b72b1
--- src/version.c	2012-10-21 22:10:42.000000000 +0200
Karsten Hopp 4b72b1
***************
Karsten Hopp 4b72b1
*** 727,728 ****
Karsten Hopp 4b72b1
--- 727,730 ----
Karsten Hopp 4b72b1
  {   /* Add new patch number below this line */
Karsten Hopp 4b72b1
+ /**/
Karsten Hopp 4b72b1
+     708,
Karsten Hopp 4b72b1
  /**/
Karsten Hopp 4b72b1
Karsten Hopp 4b72b1
-- 
Karsten Hopp 4b72b1
At some point in the project somebody will start whining about the need to
Karsten Hopp 4b72b1
determine the project "requirements".  This involves interviewing people who
Karsten Hopp 4b72b1
don't know what they want but, curiously, know exactly when they need it.
Karsten Hopp 4b72b1
				(Scott Adams - The Dilbert principle)
Karsten Hopp 4b72b1
Karsten Hopp 4b72b1
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 4b72b1
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 4b72b1
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 4b72b1
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///