summaryrefslogtreecommitdiff
path: root/src/search.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/search.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/search.c')
-rw-r--r--src/search.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c
index a4b4c4177..4b3f8532a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2601,6 +2601,8 @@ showmatch(
#endif
colnr_T save_dollar_vcol;
char_u *p;
+ long *so = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
+ long *siso = curwin->w_p_siso >= 0 ? &curwin->w_p_siso : &p_siso;
/*
* Only show match for chars in the 'matchpairs' option.
@@ -2635,8 +2637,8 @@ showmatch(
{
mpos = *lpos; /* save the pos, update_screen() may change it */
save_cursor = curwin->w_cursor;
- save_so = p_so;
- save_siso = p_siso;
+ save_so = *so;
+ save_siso = *siso;
/* Handle "$" in 'cpo': If the ')' is typed on top of the "$",
* stop displaying the "$". */
if (dollar_vcol >= 0 && dollar_vcol == curwin->w_virtcol)
@@ -2651,8 +2653,8 @@ showmatch(
ui_cursor_shape(); /* may show different cursor shape */
#endif
curwin->w_cursor = mpos; /* move to matching char */
- p_so = 0; /* don't use 'scrolloff' here */
- p_siso = 0; /* don't use 'sidescrolloff' here */
+ *so = 0; /* don't use 'scrolloff' here */
+ *siso = 0; /* don't use 'sidescrolloff' here */
showruler(FALSE);
setcursor();
cursor_on(); /* make sure that the cursor is shown */
@@ -2672,8 +2674,8 @@ showmatch(
else if (!char_avail())
ui_delay(p_mat * 100L, FALSE);
curwin->w_cursor = save_cursor; /* restore cursor position */
- p_so = save_so;
- p_siso = save_siso;
+ *so = save_so;
+ *siso = save_siso;
#ifdef CURSOR_SHAPE
State = save_state;
ui_cursor_shape(); /* may show different cursor shape */