aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-02-10 10:10:09 -0500
committerGitHub <noreply@github.com>2017-02-10 10:10:09 -0500
commitbc33df245371136d46eb198748ef7d718e0a7ed1 (patch)
tree82ca00d4834286621288b6e6487bf3a52156094b /src/nvim/window.c
parent7ed1422521eeebdd57bc79a55f4385767976a9f2 (diff)
parent67eae935575b85719f3292d428d9d5387e0d7fb8 (diff)
downloadrneovim-bc33df245371136d46eb198748ef7d718e0a7ed1.tar.gz
rneovim-bc33df245371136d46eb198748ef7d718e0a7ed1.tar.bz2
rneovim-bc33df245371136d46eb198748ef7d718e0a7ed1.zip
Merge pull request #6076 from lonerover/vim-7.4.2275
vim-patch: 7.4.2275,7.4.2279
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 510f182353..28269e8889 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -4717,8 +4717,6 @@ void set_fraction(win_T *wp)
*/
void win_new_height(win_T *wp, int height)
{
- linenr_T lnum;
- int sline, line_size;
int prev_height = wp->w_height;
/* Don't want a negative height. Happens when splitting a tiny window.
@@ -4745,6 +4743,15 @@ void win_new_height(win_T *wp, int height)
wp->w_height = height;
wp->w_skipcol = 0;
+ scroll_to_fraction(wp, prev_height);
+}
+
+void scroll_to_fraction(win_T *wp, int prev_height)
+{
+ linenr_T lnum;
+ int sline, line_size;
+ int height = wp->w_height;
+
/* Don't change w_topline when height is zero. Don't set w_topline when
* 'scrollbind' is set and this isn't the current window. */
if (height > 0