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)
diff --git a/src/window.c b/src/window.c
index d89f3a8..f78fcca 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4594,6 +4594,10 @@
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 @@
if (wp == curwin)
{
- if (p_so)
+ if (get_scrolloff_value())
update_topline();
curs_columns(FALSE); /* validate w_wrow */
}