summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-31 18:26:10 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-31 18:26:10 +0100
commit375e3390078e740d3c83b0c118c50d9a920036c7 (patch)
tree34f565d4a9351b58d48d8d06e4a84b07effdb3fd /src/window.c
parentb3051ce82f2e8af95ce3b6a41867f70aee5ecc82 (diff)
downloadvim-git-375e3390078e740d3c83b0c118c50d9a920036c7.tar.gz
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'v8.1.0864
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)
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c
index d89f3a8e6..f78fccafe 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4594,6 +4594,10 @@ win_alloc(win_T *after UNUSED, int hidden UNUSED)
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_height)
if (wp == curwin)
{
- if (p_so)
+ if (get_scrolloff_value())
update_topline();
curs_columns(FALSE); /* validate w_wrow */
}