summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.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/ex_cmds.c
parentb3051ce82f2e8af95ce3b6a41867f70aee5ecc82 (diff)
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/ex_cmds.c')
-rw-r--r--src/ex_cmds.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 6d03d88ca7..a3974c1bad 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3784,6 +3784,7 @@ do_ecmd(
#endif
int readfile_flags = 0;
int 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;
@@ -4389,12 +4390,12 @@ do_ecmd(
did_inc_redrawing_disabled = FALSE;
if (!skip_redraw)
{
- n = p_so;
+ n = *so_ptr;
if (topline == 0 && command == NULL)
- p_so = 999; /* force cursor halfway the window */
+ *so_ptr = 9999; // force cursor halfway the window
update_topline();
curwin->w_scbind_pos = curwin->w_topline;
- p_so = n;
+ *so_ptr = n;
redraw_curbuf_later(NOT_VALID); /* redraw this buffer later */
}