]> git.lyx.org Git - features.git/blobdiff - src/frontends/LyXView.C
Immediate rendering of buffer change for one or multiple LyXView.
[features.git] / src / frontends / LyXView.C
index 5f600ac88af2015a9cebace10cf5d04980e3be13..3643581101f22b32a6523e7e9f347ce92cf2af73 100644 (file)
@@ -94,14 +94,6 @@ void LyXView::setWorkArea(WorkArea * work_area)
 }
 
 
-void LyXView::redrawWorkArea()
-{
-       lyxerr[Debug::WORKAREA] << "LyXView::redrawWorkArea" << std::endl;
-       work_area_->redraw();
-       updateStatusBar();
-}
-
-
 WorkArea * LyXView::workArea()
 {
        return work_area_;
@@ -136,7 +128,8 @@ void LyXView::setBuffer(Buffer * b)
        updateToolbars();
        updateLayoutChoice();
        updateWindowTitle();
-       redrawWorkArea();
+       updateStatusBar();
+       work_area_->redraw();
 }
 
 
@@ -155,7 +148,8 @@ bool LyXView::loadLyXFile(string const & filename, bool tolastfiles)
                connectBuffer(*work_area_->bufferView().buffer());
                showErrorList("Parse");
        }
-       redrawWorkArea();
+       updateStatusBar();
+       work_area_->redraw();
        return loaded;
 }
 
@@ -165,6 +159,10 @@ void LyXView::connectBuffer(Buffer & buf)
        if (errorsConnection_.connected())
                disconnectBuffer();
 
+       bufferChangedConnection_ =
+               buf.changed.connect(
+                       boost::bind(&WorkArea::redraw, work_area_));
+
        errorsConnection_ =
                buf.errors.connect(
                        boost::bind(&LyXView::showErrorList, this, _1));
@@ -197,6 +195,8 @@ void LyXView::connectBuffer(Buffer & buf)
 
 void LyXView::disconnectBuffer()
 {
+       errorsConnection_.disconnect();
+       bufferChangedConnection_.disconnect();
        messageConnection_.disconnect();
        busyConnection_.disconnect();
        titleConnection_.disconnect();