To: vim_dev@googlegroups.com Subject: Patch 8.0.1707 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1707 Problem: When 'wfh' is set ":bel 10new" scrolls window. (Andrew Pyatkov) Solution: Set the fraction before changing the window height. (closes #2798) Files: src/window.c *** ../vim-8.0.1706/src/window.c 2018-04-10 18:47:16.097527017 +0200 --- src/window.c 2018-04-13 22:02:07.252980535 +0200 *************** *** 778,783 **** --- 778,784 ---- int before; int minheight; int wmh1; + int did_set_fraction = FALSE; if (flags & WSP_TOP) oldwin = firstwin; *************** *** 959,964 **** --- 960,970 ---- * instead, if possible. */ 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, oldwin); oldwin_height = oldwin->w_height; *************** *** 1088,1094 **** /* Set w_fraction now so that the cursor keeps the same relative * vertical position. */ ! set_fraction(oldwin); wp->w_fraction = oldwin->w_fraction; if (flags & WSP_VERT) --- 1094,1101 ---- /* Set w_fraction now so that the cursor keeps the same relative * vertical position. */ ! if (!did_set_fraction) ! set_fraction(oldwin); wp->w_fraction = oldwin->w_fraction; if (flags & WSP_VERT) *** ../vim-8.0.1706/src/version.c 2018-04-13 22:11:52.740902329 +0200 --- src/version.c 2018-04-13 22:14:56.015620469 +0200 *************** *** 764,765 **** --- 764,767 ---- { /* Add new patch number below this line */ + /**/ + 1707, /**/ -- hundred-and-one symptoms of being an internet addict: 173. You keep tracking down the email addresses of all your friends (even childhood friends). /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///