aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorWill Eccles <will@eccles.dev>2020-03-17 15:05:34 -0400
committerGitHub <noreply@github.com>2020-03-17 20:05:34 +0100
commit87d892afa0475644e91d9c8a57b7c35491c4dc32 (patch)
treea3d0f66e64156fbbb47864a6ed36129bd7c41318 /src/nvim/ex_cmds.c
parent5a5c2f0290b5cdb8ccc1a06cb41f248ab25fd792 (diff)
downloadrneovim-87d892afa0475644e91d9c8a57b7c35491c4dc32.tar.gz
rneovim-87d892afa0475644e91d9c8a57b7c35491c4dc32.tar.bz2
rneovim-87d892afa0475644e91d9c8a57b7c35491c4dc32.zip
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 https://github.com/vim/vim/commit/375e3390078e740d3c83b0c118c50d9a920036c7
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index a2c4435014..1cd95f2ed9 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -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)