diff src/window.c @ 15713:ad8b2c109b22 v8.1.0864

patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff' commit https://github.com/vim/vim/commit/375e3390078e740d3c83b0c118c50d9a920036c7 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 31 18:26:10 2019 +0100 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff' Problem: Cannot have a local value for 'scrolloff' and 'sidescrolloff'. (Gary Holloway) Solution: Make 'scrolloff' and 'sidescrolloff' global-local. (mostly by Aron Widforss, closes #3539)
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Jan 2019 18:30:08 +0100
parents 6f1c7e9a6393
children 77e97f159554
line wrap: on
line diff
--- a/src/window.c
+++ b/src/window.c
@@ -4594,6 +4594,10 @@ win_alloc(win_T *after UNUSED, int hidde
     new_wp->w_cursor.lnum = 1;
     new_wp->w_scbind_pos = 1;
 
+    // use global option value for global-local options
+    new_wp->w_p_so = -1;
+    new_wp->w_p_siso = -1;
+
     /* We won't calculate w_fraction until resizing the window */
     new_wp->w_fraction = 0;
     new_wp->w_prev_fraction_row = -1;
@@ -5871,7 +5875,7 @@ scroll_to_fraction(win_T *wp, int prev_h
 
     if (wp == curwin)
     {
-	if (p_so)
+	if (get_scrolloff_value())
 	    update_topline();
 	curs_columns(FALSE);	/* validate w_wrow */
     }