Skip to content

Commit 63efadb

Browse files
committed
updated for version 7.4.131
Problem: Syncbind causes E315 errors in some situations. (Liang Li) Solution: Set and restore curbuf in ex_syncbind(). (Christian Brabandt)
1 parent 4568036 commit 63efadb

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/ex_docmd.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8054,6 +8054,8 @@ ex_syncbind(eap)
80548054
{
80558055
#ifdef FEAT_SCROLLBIND
80568056
win_T *wp;
8057+
win_T *save_curwin = curwin;
8058+
buf_T *save_curbuf = curbuf;
80578059
long topline;
80588060
long y;
80598061
linenr_T old_linenr = curwin->w_cursor.lnum;
@@ -8085,13 +8087,13 @@ ex_syncbind(eap)
80858087

80868088

80878089
/*
8088-
* set all scrollbind windows to the same topline
8090+
* Set all scrollbind windows to the same topline.
80898091
*/
8090-
wp = curwin;
80918092
for (curwin = firstwin; curwin; curwin = curwin->w_next)
80928093
{
80938094
if (curwin->w_p_scb)
80948095
{
8096+
curbuf = curwin->w_buffer;
80958097
y = topline - curwin->w_topline;
80968098
if (y > 0)
80978099
scrollup(y, TRUE);
@@ -8105,7 +8107,8 @@ ex_syncbind(eap)
81058107
#endif
81068108
}
81078109
}
8108-
curwin = wp;
8110+
curwin = save_curwin;
8111+
curbuf = save_curbuf;
81098112
if (curwin->w_p_scb)
81108113
{
81118114
did_syncbind = TRUE;

src/testdir/test37.ok

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ UTSRQPONMLKJIHGREDCBA9876543210 02
2727

2828
. line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
2929
:set scrollbind
30-
zt:
31-
. line 15 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 15
3230
:set scrollbind
33-
. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
31+
. line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
32+
j:
33+
. line 12 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 12

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
131,
741743
/**/
742744
130,
743745
/**/

0 commit comments

Comments
 (0)