mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.0.1707: when 'wfh' is set ":bel 10new" scrolls window
Problem: When 'wfh' is set ":bel 10new" scrolls window. (Andrew Pyatkov) Solution: Set the fraction before changing the window height. (closes #2798)
This commit is contained in:
@@ -762,6 +762,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 */
|
||||||
|
/**/
|
||||||
|
1707,
|
||||||
/**/
|
/**/
|
||||||
1706,
|
1706,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -778,6 +778,7 @@ win_split_ins(
|
|||||||
int before;
|
int before;
|
||||||
int minheight;
|
int minheight;
|
||||||
int wmh1;
|
int wmh1;
|
||||||
|
int did_set_fraction = FALSE;
|
||||||
|
|
||||||
if (flags & WSP_TOP)
|
if (flags & WSP_TOP)
|
||||||
oldwin = firstwin;
|
oldwin = firstwin;
|
||||||
@@ -959,6 +960,11 @@ win_split_ins(
|
|||||||
* instead, if possible. */
|
* instead, if possible. */
|
||||||
if (oldwin->w_p_wfh)
|
if (oldwin->w_p_wfh)
|
||||||
{
|
{
|
||||||
|
/* Set w_fraction now so that the cursor keeps the same relative
|
||||||
|
* vertical position using the old height. */
|
||||||
|
set_fraction(oldwin);
|
||||||
|
did_set_fraction = TRUE;
|
||||||
|
|
||||||
win_setheight_win(oldwin->w_height + new_size + STATUS_HEIGHT,
|
win_setheight_win(oldwin->w_height + new_size + STATUS_HEIGHT,
|
||||||
oldwin);
|
oldwin);
|
||||||
oldwin_height = oldwin->w_height;
|
oldwin_height = oldwin->w_height;
|
||||||
@@ -1088,6 +1094,7 @@ win_split_ins(
|
|||||||
|
|
||||||
/* Set w_fraction now so that the cursor keeps the same relative
|
/* Set w_fraction now so that the cursor keeps the same relative
|
||||||
* vertical position. */
|
* vertical position. */
|
||||||
|
if (!did_set_fraction)
|
||||||
set_fraction(oldwin);
|
set_fraction(oldwin);
|
||||||
wp->w_fraction = oldwin->w_fraction;
|
wp->w_fraction = oldwin->w_fraction;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user