1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2013-12-14 13:06:17 +01:00
parent 0bd7b3f4ce
commit dedd1b0aba
3 changed files with 11 additions and 6 deletions

View File

@@ -8054,6 +8054,8 @@ ex_syncbind(eap)
{ {
#ifdef FEAT_SCROLLBIND #ifdef FEAT_SCROLLBIND
win_T *wp; win_T *wp;
win_T *save_curwin = curwin;
buf_T *save_curbuf = curbuf;
long topline; long topline;
long y; long y;
linenr_T old_linenr = curwin->w_cursor.lnum; linenr_T old_linenr = curwin->w_cursor.lnum;
@@ -8085,13 +8087,13 @@ ex_syncbind(eap)
/* /*
* 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) for (curwin = firstwin; curwin; curwin = curwin->w_next)
{ {
if (curwin->w_p_scb) if (curwin->w_p_scb)
{ {
curbuf = curwin->w_buffer;
y = topline - curwin->w_topline; y = topline - curwin->w_topline;
if (y > 0) if (y > 0)
scrollup(y, TRUE); scrollup(y, TRUE);
@@ -8105,7 +8107,8 @@ ex_syncbind(eap)
#endif #endif
} }
} }
curwin = wp; curwin = save_curwin;
curbuf = save_curbuf;
if (curwin->w_p_scb) if (curwin->w_p_scb)
{ {
did_syncbind = TRUE; did_syncbind = TRUE;

View File

@@ -27,7 +27,7 @@ UTSRQPONMLKJIHGREDCBA9876543210 02
. line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16 . line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
:set scrollbind :set scrollbind
zt:
. line 15 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 15
:set scrollbind :set scrollbind
. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11 . line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
j:
. line 12 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 12

View File

@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
131,
/**/ /**/
130, 130,
/**/ /**/