aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index db6c0f9048..dc0ce03794 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -4803,7 +4803,11 @@ void win_new_height(win_T *wp, int height)
wp->w_height = height;
wp->w_skipcol = 0;
- scroll_to_fraction(wp, prev_height);
+ // There is no point in adjusting the scroll position when exiting. Some
+ // values might be invalid.
+ if (!exiting) {
+ scroll_to_fraction(wp, prev_height);
+ }
}
void scroll_to_fraction(win_T *wp, int prev_height)