0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

updated for version 7.2.398

Problem:    When moving windows the cursor ends up in the wrong line.
Solution:   Set the window width and height properly. (Lech Lorens)
This commit is contained in:
Bram Moolenaar
2010-03-17 16:54:57 +01:00
parent 08bb82e8c5
commit 9b73a78ed7
2 changed files with 13 additions and 7 deletions

View File

@@ -681,6 +681,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
398,
/**/ /**/
397, 397,
/**/ /**/

View File

@@ -991,28 +991,28 @@ win_split_ins(size, flags, newwin, dir)
wp->w_p_scr = curwin->w_p_scr; wp->w_p_scr = curwin->w_p_scr;
if (need_status) if (need_status)
{ {
--oldwin->w_height; win_new_height(oldwin, oldwin->w_height - 1);
oldwin->w_status_height = need_status; oldwin->w_status_height = need_status;
} }
if (flags & (WSP_TOP | WSP_BOT)) if (flags & (WSP_TOP | WSP_BOT))
{ {
/* set height and row of new window to full height */ /* set height and row of new window to full height */
wp->w_winrow = tabline_height(); wp->w_winrow = tabline_height();
wp->w_height = curfrp->fr_height - (p_ls > 0); win_new_height(wp, curfrp->fr_height - (p_ls > 0));
wp->w_status_height = (p_ls > 0); wp->w_status_height = (p_ls > 0);
} }
else else
{ {
/* height and row of new window is same as current window */ /* height and row of new window is same as current window */
wp->w_winrow = oldwin->w_winrow; wp->w_winrow = oldwin->w_winrow;
wp->w_height = oldwin->w_height; win_new_height(wp, oldwin->w_height);
wp->w_status_height = oldwin->w_status_height; wp->w_status_height = oldwin->w_status_height;
} }
frp->fr_height = curfrp->fr_height; frp->fr_height = curfrp->fr_height;
/* "new_size" of the current window goes to the new window, use /* "new_size" of the current window goes to the new window, use
* one column for the vertical separator */ * one column for the vertical separator */
wp->w_width = new_size; win_new_width(wp, new_size);
if (before) if (before)
wp->w_vsep_width = 1; wp->w_vsep_width = 1;
else else
@@ -1049,13 +1049,13 @@ win_split_ins(size, flags, newwin, dir)
if (flags & (WSP_TOP | WSP_BOT)) if (flags & (WSP_TOP | WSP_BOT))
{ {
wp->w_wincol = 0; wp->w_wincol = 0;
wp->w_width = Columns; win_new_width(wp, Columns);
wp->w_vsep_width = 0; wp->w_vsep_width = 0;
} }
else else
{ {
wp->w_wincol = oldwin->w_wincol; wp->w_wincol = oldwin->w_wincol;
wp->w_width = oldwin->w_width; win_new_width(wp, oldwin->w_width);
wp->w_vsep_width = oldwin->w_vsep_width; wp->w_vsep_width = oldwin->w_vsep_width;
} }
frp->fr_width = curfrp->fr_width; frp->fr_width = curfrp->fr_width;
@@ -1111,7 +1111,7 @@ win_split_ins(size, flags, newwin, dir)
} }
/* /*
* make the new window the current window and redraw * equalize the window sizes.
*/ */
if (do_equal || dir != 0) if (do_equal || dir != 0)
win_equal(wp, TRUE, win_equal(wp, TRUE,
@@ -1143,6 +1143,10 @@ win_split_ins(size, flags, newwin, dir)
if (size != 0) if (size != 0)
p_wh = size; p_wh = size;
} }
/*
* make the new window the current window
*/
win_enter(wp, FALSE); win_enter(wp, FALSE);
#ifdef FEAT_VERTSPLIT #ifdef FEAT_VERTSPLIT
if (flags & WSP_VERT) if (flags & WSP_VERT)