jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.372

3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.372
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.372
3ef2ca
Problem:    When 'winminheight' is zero there might not be one line for the
3ef2ca
	    current window.
3ef2ca
Solution:   Change the size computations. (Yukihiro Nakadaira)
3ef2ca
Files:	    src/window.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.371/src/window.c	2014-07-16 16:30:21.647608710 +0200
3ef2ca
--- src/window.c	2014-07-16 18:06:53.123491001 +0200
3ef2ca
***************
3ef2ca
*** 688,693 ****
3ef2ca
--- 688,695 ----
3ef2ca
      int		before;
3ef2ca
      int		minwidth;
3ef2ca
      int		minheight;
3ef2ca
+     int		wmw1;
3ef2ca
+     int		wmh1;
3ef2ca
  
3ef2ca
      if (flags & WSP_TOP)
3ef2ca
  	oldwin = firstwin;
3ef2ca
***************
3ef2ca
*** 722,740 ****
3ef2ca
  	 * Check if we are able to split the current window and compute its
3ef2ca
  	 * width.
3ef2ca
  	 */
3ef2ca
! 	needed = p_wmw + 1;
3ef2ca
  	if (flags & WSP_ROOM)
3ef2ca
! 	    needed += p_wiw - p_wmw;
3ef2ca
  	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
3ef2ca
  	{
3ef2ca
! 	    minwidth = frame_minwidth(topframe, NULL);
3ef2ca
  	    available = topframe->fr_width;
3ef2ca
  	    needed += minwidth;
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
! 	    minwidth = frame_minwidth(oldwin->w_frame, NULL);
3ef2ca
! 	    available = oldwin->w_width;
3ef2ca
  	}
3ef2ca
  	if (available < needed && new_wp == NULL)
3ef2ca
  	{
3ef2ca
--- 724,745 ----
3ef2ca
  	 * Check if we are able to split the current window and compute its
3ef2ca
  	 * width.
3ef2ca
  	 */
3ef2ca
! 	/* Current window requires at least 1 space. */
3ef2ca
! 	wmw1 = (p_wmw == 0 ? 1 : p_wmw);
3ef2ca
! 	needed = wmw1 + 1;
3ef2ca
  	if (flags & WSP_ROOM)
3ef2ca
! 	    needed += p_wiw - wmw1;
3ef2ca
  	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
3ef2ca
  	{
3ef2ca
! 	    minwidth = frame_minwidth(topframe, NOWIN);
3ef2ca
  	    available = topframe->fr_width;
3ef2ca
  	    needed += minwidth;
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
! 	    minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
3ef2ca
! 	    available = oldwin->w_frame->fr_width;
3ef2ca
! 	    needed += minwidth;
3ef2ca
  	}
3ef2ca
  	if (available < needed && new_wp == NULL)
3ef2ca
  	{
3ef2ca
***************
3ef2ca
*** 743,754 ****
3ef2ca
  	}
3ef2ca
  	if (new_size == 0)
3ef2ca
  	    new_size = oldwin->w_width / 2;
3ef2ca
- 	if (new_size > oldwin->w_width - p_wmw - 1)
3ef2ca
- 	    new_size = oldwin->w_width - p_wmw - 1;
3ef2ca
  	if (new_size > available - minwidth - 1)
3ef2ca
  	    new_size = available - minwidth - 1;
3ef2ca
! 	if (new_size < p_wmw)
3ef2ca
! 	    new_size = p_wmw;
3ef2ca
  
3ef2ca
  	/* if it doesn't fit in the current window, need win_equal() */
3ef2ca
  	if (oldwin->w_width - new_size - 1 < p_wmw)
3ef2ca
--- 748,757 ----
3ef2ca
  	}
3ef2ca
  	if (new_size == 0)
3ef2ca
  	    new_size = oldwin->w_width / 2;
3ef2ca
  	if (new_size > available - minwidth - 1)
3ef2ca
  	    new_size = available - minwidth - 1;
3ef2ca
! 	if (new_size < wmw1)
3ef2ca
! 	    new_size = wmw1;
3ef2ca
  
3ef2ca
  	/* if it doesn't fit in the current window, need win_equal() */
3ef2ca
  	if (oldwin->w_width - new_size - 1 < p_wmw)
3ef2ca
***************
3ef2ca
*** 789,808 ****
3ef2ca
  	 * Check if we are able to split the current window and compute its
3ef2ca
  	 * height.
3ef2ca
  	 */
3ef2ca
! 	needed = p_wmh + STATUS_HEIGHT + need_status;
3ef2ca
  	if (flags & WSP_ROOM)
3ef2ca
! 	    needed += p_wh - p_wmh;
3ef2ca
  	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
3ef2ca
  	{
3ef2ca
! 	    minheight = frame_minheight(topframe, NULL);
3ef2ca
  	    available = topframe->fr_height;
3ef2ca
  	    needed += minheight;
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
! 	    minheight = frame_minheight(oldwin->w_frame, NULL);
3ef2ca
! 	    available = oldwin->w_height;
3ef2ca
! 	    needed += p_wmh;
3ef2ca
  	}
3ef2ca
  	if (available < needed && new_wp == NULL)
3ef2ca
  	{
3ef2ca
--- 792,813 ----
3ef2ca
  	 * Check if we are able to split the current window and compute its
3ef2ca
  	 * height.
3ef2ca
  	 */
3ef2ca
! 	/* Current window requires at least 1 space. */
3ef2ca
! 	wmh1 = (p_wmh == 0 ? 1 : p_wmh);
3ef2ca
! 	needed = wmh1 + STATUS_HEIGHT;
3ef2ca
  	if (flags & WSP_ROOM)
3ef2ca
! 	    needed += p_wh - wmh1;
3ef2ca
  	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
3ef2ca
  	{
3ef2ca
! 	    minheight = frame_minheight(topframe, NOWIN) + need_status;
3ef2ca
  	    available = topframe->fr_height;
3ef2ca
  	    needed += minheight;
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
! 	    minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
3ef2ca
! 	    available = oldwin->w_frame->fr_height;
3ef2ca
! 	    needed += minheight;
3ef2ca
  	}
3ef2ca
  	if (available < needed && new_wp == NULL)
3ef2ca
  	{
3ef2ca
***************
3ef2ca
*** 817,829 ****
3ef2ca
  	}
3ef2ca
  	if (new_size == 0)
3ef2ca
  	    new_size = oldwin_height / 2;
3ef2ca
- 
3ef2ca
- 	if (new_size > oldwin_height - p_wmh - STATUS_HEIGHT)
3ef2ca
- 	    new_size = oldwin_height - p_wmh - STATUS_HEIGHT;
3ef2ca
  	if (new_size > available - minheight - STATUS_HEIGHT)
3ef2ca
  	    new_size = available - minheight - STATUS_HEIGHT;
3ef2ca
! 	if (new_size < p_wmh)
3ef2ca
! 	    new_size = p_wmh;
3ef2ca
  
3ef2ca
  	/* if it doesn't fit in the current window, need win_equal() */
3ef2ca
  	if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
3ef2ca
--- 822,831 ----
3ef2ca
  	}
3ef2ca
  	if (new_size == 0)
3ef2ca
  	    new_size = oldwin_height / 2;
3ef2ca
  	if (new_size > available - minheight - STATUS_HEIGHT)
3ef2ca
  	    new_size = available - minheight - STATUS_HEIGHT;
3ef2ca
! 	if (new_size < wmh1)
3ef2ca
! 	    new_size = wmh1;
3ef2ca
  
3ef2ca
  	/* if it doesn't fit in the current window, need win_equal() */
3ef2ca
  	if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
3ef2ca
*** ../vim-7.4.371/src/version.c	2014-07-16 17:29:46.691536252 +0200
3ef2ca
--- src/version.c	2014-07-16 17:34:14.795530803 +0200
3ef2ca
***************
3ef2ca
*** 736,737 ****
3ef2ca
--- 736,739 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     372,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
   [The rest of the ARMY stand around looking at a loss.]
3ef2ca
INSPECTOR END OF FILM: (picks up megaphone) All right!  Clear off!  Go on!
3ef2ca
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///