Problem: Syncbind causes E315 errors in some situations. (Liang Li)
Solution: Set and restore curbuf in ex_syncbind(). (Christian Brabandt)
{
#ifdef FEAT_SCROLLBIND
win_T *wp;
+ win_T *save_curwin = curwin;
+ buf_T *save_curbuf = curbuf;
long topline;
long y;
linenr_T old_linenr = curwin->w_cursor.lnum;
/*
- * set all scrollbind windows to the same topline
+ * Set all scrollbind windows to the same topline.
*/
- wp = curwin;
for (curwin = firstwin; curwin; curwin = curwin->w_next)
{
if (curwin->w_p_scb)
{
+ curbuf = curwin->w_buffer;
y = topline - curwin->w_topline;
if (y > 0)
scrollup(y, TRUE);
#endif
}
}
- curwin = wp;
+ curwin = save_curwin;
+ curbuf = save_curbuf;
if (curwin->w_p_scb)
{
did_syncbind = TRUE;
. line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
:set scrollbind
-zt:
-. line 15 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 15
:set scrollbind
-. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
+. line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
+\17j:
+. line 12 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 12
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 131,
/**/
130,
/**/