Mercurial > vim
diff src/ex_docmd.c @ 5566:4b23119cb584 v7.4.131
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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 14 Dec 2013 13:06:17 +0100 |
parents | 4bf53c1ef37a |
children | c8c80c9d2e22 |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -8054,6 +8054,8 @@ ex_syncbind(eap) { #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; @@ -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) { if (curwin->w_p_scb) { + curbuf = curwin->w_buffer; y = topline - curwin->w_topline; if (y > 0) scrollup(y, TRUE); @@ -8105,7 +8107,8 @@ ex_syncbind(eap) #endif } } - curwin = wp; + curwin = save_curwin; + curbuf = save_curbuf; if (curwin->w_p_scb) { did_syncbind = TRUE;