Karsten Hopp 88aacb
To: vim-dev@vim.org
Karsten Hopp 88aacb
Subject: Patch 7.2.398
Karsten Hopp 88aacb
Fcc: outbox
Karsten Hopp 88aacb
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 88aacb
Mime-Version: 1.0
Karsten Hopp 88aacb
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 88aacb
Content-Transfer-Encoding: 8bit
Karsten Hopp 88aacb
------------
Karsten Hopp 88aacb
Karsten Hopp 88aacb
Patch 7.2.398
Karsten Hopp 88aacb
Problem:    When moving windows the cursor ends up in the wrong line.
Karsten Hopp 88aacb
Solution:   Set the window width and height properly. (Lech Lorens)
Karsten Hopp 88aacb
Files:	    src/window.c
Karsten Hopp 88aacb
Karsten Hopp 88aacb
Karsten Hopp 88aacb
*** ../vim-7.2.397/src/window.c	2010-01-27 20:26:41.000000000 +0100
Karsten Hopp 88aacb
--- src/window.c	2010-03-17 16:40:06.000000000 +0100
Karsten Hopp 88aacb
***************
Karsten Hopp 88aacb
*** 991,1018 ****
Karsten Hopp 88aacb
  	wp->w_p_scr = curwin->w_p_scr;
Karsten Hopp 88aacb
  	if (need_status)
Karsten Hopp 88aacb
  	{
Karsten Hopp 88aacb
! 	    --oldwin->w_height;
Karsten Hopp 88aacb
  	    oldwin->w_status_height = need_status;
Karsten Hopp 88aacb
  	}
Karsten Hopp 88aacb
  	if (flags & (WSP_TOP | WSP_BOT))
Karsten Hopp 88aacb
  	{
Karsten Hopp 88aacb
  	    /* set height and row of new window to full height */
Karsten Hopp 88aacb
  	    wp->w_winrow = tabline_height();
Karsten Hopp 88aacb
! 	    wp->w_height = curfrp->fr_height - (p_ls > 0);
Karsten Hopp 88aacb
  	    wp->w_status_height = (p_ls > 0);
Karsten Hopp 88aacb
  	}
Karsten Hopp 88aacb
  	else
Karsten Hopp 88aacb
  	{
Karsten Hopp 88aacb
  	    /* height and row of new window is same as current window */
Karsten Hopp 88aacb
  	    wp->w_winrow = oldwin->w_winrow;
Karsten Hopp 88aacb
! 	    wp->w_height = oldwin->w_height;
Karsten Hopp 88aacb
  	    wp->w_status_height = oldwin->w_status_height;
Karsten Hopp 88aacb
  	}
Karsten Hopp 88aacb
  	frp->fr_height = curfrp->fr_height;
Karsten Hopp 88aacb
  
Karsten Hopp 88aacb
  	/* "new_size" of the current window goes to the new window, use
Karsten Hopp 88aacb
  	 * one column for the vertical separator */
Karsten Hopp 88aacb
! 	wp->w_width = new_size;
Karsten Hopp 88aacb
  	if (before)
Karsten Hopp 88aacb
  	    wp->w_vsep_width = 1;
Karsten Hopp 88aacb
  	else
Karsten Hopp 88aacb
--- 991,1018 ----
Karsten Hopp 88aacb
  	wp->w_p_scr = curwin->w_p_scr;
Karsten Hopp 88aacb
  	if (need_status)
Karsten Hopp 88aacb
  	{
Karsten Hopp 88aacb
! 	    win_new_height(oldwin, oldwin->w_height - 1);
Karsten Hopp 88aacb
  	    oldwin->w_status_height = need_status;
Karsten Hopp 88aacb
  	}
Karsten Hopp 88aacb
  	if (flags & (WSP_TOP | WSP_BOT))
Karsten Hopp 88aacb
  	{
Karsten Hopp 88aacb
  	    /* set height and row of new window to full height */
Karsten Hopp 88aacb
  	    wp->w_winrow = tabline_height();
Karsten Hopp 88aacb
! 	    win_new_height(wp, curfrp->fr_height - (p_ls > 0));
Karsten Hopp 88aacb
  	    wp->w_status_height = (p_ls > 0);
Karsten Hopp 88aacb
  	}
Karsten Hopp 88aacb
  	else
Karsten Hopp 88aacb
  	{
Karsten Hopp 88aacb
  	    /* height and row of new window is same as current window */
Karsten Hopp 88aacb
  	    wp->w_winrow = oldwin->w_winrow;
Karsten Hopp 88aacb
! 	    win_new_height(wp, oldwin->w_height);
Karsten Hopp 88aacb
  	    wp->w_status_height = oldwin->w_status_height;
Karsten Hopp 88aacb
  	}
Karsten Hopp 88aacb
  	frp->fr_height = curfrp->fr_height;
Karsten Hopp 88aacb
  
Karsten Hopp 88aacb
  	/* "new_size" of the current window goes to the new window, use
Karsten Hopp 88aacb
  	 * one column for the vertical separator */
Karsten Hopp 88aacb
! 	win_new_width(wp, new_size);
Karsten Hopp 88aacb
  	if (before)
Karsten Hopp 88aacb
  	    wp->w_vsep_width = 1;
Karsten Hopp 88aacb
  	else
Karsten Hopp 88aacb
***************
Karsten Hopp 88aacb
*** 1049,1061 ****
Karsten Hopp 88aacb
  	if (flags & (WSP_TOP | WSP_BOT))
Karsten Hopp 88aacb
  	{
Karsten Hopp 88aacb
  	    wp->w_wincol = 0;
Karsten Hopp 88aacb
! 	    wp->w_width = Columns;
Karsten Hopp 88aacb
  	    wp->w_vsep_width = 0;
Karsten Hopp 88aacb
  	}
Karsten Hopp 88aacb
  	else
Karsten Hopp 88aacb
  	{
Karsten Hopp 88aacb
  	    wp->w_wincol = oldwin->w_wincol;
Karsten Hopp 88aacb
! 	    wp->w_width = oldwin->w_width;
Karsten Hopp 88aacb
  	    wp->w_vsep_width = oldwin->w_vsep_width;
Karsten Hopp 88aacb
  	}
Karsten Hopp 88aacb
  	frp->fr_width = curfrp->fr_width;
Karsten Hopp 88aacb
--- 1049,1061 ----
Karsten Hopp 88aacb
  	if (flags & (WSP_TOP | WSP_BOT))
Karsten Hopp 88aacb
  	{
Karsten Hopp 88aacb
  	    wp->w_wincol = 0;
Karsten Hopp 88aacb
! 	    win_new_width(wp, Columns);
Karsten Hopp 88aacb
  	    wp->w_vsep_width = 0;
Karsten Hopp 88aacb
  	}
Karsten Hopp 88aacb
  	else
Karsten Hopp 88aacb
  	{
Karsten Hopp 88aacb
  	    wp->w_wincol = oldwin->w_wincol;
Karsten Hopp 88aacb
! 	    win_new_width(wp, oldwin->w_width);
Karsten Hopp 88aacb
  	    wp->w_vsep_width = oldwin->w_vsep_width;
Karsten Hopp 88aacb
  	}
Karsten Hopp 88aacb
  	frp->fr_width = curfrp->fr_width;
Karsten Hopp 88aacb
***************
Karsten Hopp 88aacb
*** 1111,1117 ****
Karsten Hopp 88aacb
      }
Karsten Hopp 88aacb
  
Karsten Hopp 88aacb
      /*
Karsten Hopp 88aacb
!      * make the new window the current window and redraw
Karsten Hopp 88aacb
       */
Karsten Hopp 88aacb
      if (do_equal || dir != 0)
Karsten Hopp 88aacb
  	win_equal(wp, TRUE,
Karsten Hopp 88aacb
--- 1111,1117 ----
Karsten Hopp 88aacb
      }
Karsten Hopp 88aacb
  
Karsten Hopp 88aacb
      /*
Karsten Hopp 88aacb
!      * equalize the window sizes.
Karsten Hopp 88aacb
       */
Karsten Hopp 88aacb
      if (do_equal || dir != 0)
Karsten Hopp 88aacb
  	win_equal(wp, TRUE,
Karsten Hopp 88aacb
***************
Karsten Hopp 88aacb
*** 1143,1148 ****
Karsten Hopp 88aacb
--- 1143,1152 ----
Karsten Hopp 88aacb
  	if (size != 0)
Karsten Hopp 88aacb
  	    p_wh = size;
Karsten Hopp 88aacb
      }
Karsten Hopp 88aacb
+ 
Karsten Hopp 88aacb
+     /*
Karsten Hopp 88aacb
+      * make the new window the current window
Karsten Hopp 88aacb
+      */
Karsten Hopp 88aacb
      win_enter(wp, FALSE);
Karsten Hopp 88aacb
  #ifdef FEAT_VERTSPLIT
Karsten Hopp 88aacb
      if (flags & WSP_VERT)
Karsten Hopp 88aacb
*** ../vim-7.2.397/src/version.c	2010-03-17 16:45:04.000000000 +0100
Karsten Hopp 88aacb
--- src/version.c	2010-03-17 16:53:51.000000000 +0100
Karsten Hopp 88aacb
***************
Karsten Hopp 88aacb
*** 683,684 ****
Karsten Hopp 88aacb
--- 683,686 ----
Karsten Hopp 88aacb
  {   /* Add new patch number below this line */
Karsten Hopp 88aacb
+ /**/
Karsten Hopp 88aacb
+     398,
Karsten Hopp 88aacb
  /**/
Karsten Hopp 88aacb
Karsten Hopp 88aacb
-- 
Karsten Hopp 88aacb
It's not hard to meet expenses, they're everywhere.
Karsten Hopp 88aacb
Karsten Hopp 88aacb
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 88aacb
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 88aacb
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 88aacb
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///