vim-patch:8.1.0864 Make 'scrolloff' and 'sidescrolloff' options window local (#11854)

Problem: cannot have a local value for 'scrolloff' and 'sidescrolloff'

Author: Bram Moolenar

375e339007
This commit is contained in:
Will Eccles
2020-03-17 15:05:34 -04:00
committed by GitHub
parent 5a5c2f0290
commit 87d892afa0
14 changed files with 245 additions and 126 deletions

View File

@@ -2177,6 +2177,7 @@ int do_ecmd(
int did_get_winopts = FALSE;
int readfile_flags = 0;
bool did_inc_redrawing_disabled = false;
long *so_ptr = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
if (eap != NULL)
command = eap->do_ecmd_cmd;
@@ -2678,13 +2679,14 @@ int do_ecmd(
RedrawingDisabled--;
did_inc_redrawing_disabled = false;
if (!skip_redraw) {
n = p_so;
if (topline == 0 && command == NULL)
p_so = 999; // force cursor to be vertically centered in the window
n = *so_ptr;
if (topline == 0 && command == NULL) {
*so_ptr = 999; // force cursor to be vertically centered in the window
}
update_topline();
curwin->w_scbind_pos = curwin->w_topline;
p_so = n;
redraw_curbuf_later(NOT_VALID); /* redraw this buffer later */
*so_ptr = n;
redraw_curbuf_later(NOT_VALID); // redraw this buffer later
}
if (p_im)