]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
typo
[lyx.git] / src / Cursor.cpp
index faa612727e15e13a162d3149cb366aa6562211f7..e4a34b158ce88590237ee7ad3c4c75ec6b118409 100644 (file)
@@ -54,6 +54,7 @@
 #include <sstream>
 #include <limits>
 #include <map>
+#include <algorithm>
 
 using namespace std;
 
@@ -1275,6 +1276,7 @@ void Cursor::plainInsert(MathAtom const & t)
        ++pos();
        inset().setBuffer(bv_->buffer());
        inset().initView();
+       forceBufferUpdate();
 }
 
 
@@ -1317,6 +1319,8 @@ void Cursor::insert(Inset * inset0)
                text()->insertInset(*this, inset0);
                inset0->setBuffer(bv_->buffer());
                inset0->initView();
+               if (inset0->isLabeled())
+                       forceBufferUpdate();
        }
 }
 
@@ -1358,7 +1362,7 @@ void Cursor::insert(MathData const & ar)
                cap::eraseSelection(*this);
        cell().insert(pos(), ar);
        pos() += ar.size();
-       // FIXME audit setBuffer/updateBuffer calls
+       // FIXME audit setBuffer calls
        inset().setBuffer(bv_->buffer());
 }
 
@@ -1509,7 +1513,7 @@ bool Cursor::macroModeClose()
 
        // trigger updates of macros, at least, if no full
        // updates take place anyway
-       updateFlags(Update::Force);
+       screenUpdateFlags(Update::Force);
 
        docstring const name = s.substr(1);
        InsetMathNest * const in = inset().asInsetMath()->asNestInset();
@@ -1882,6 +1886,8 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
 
                        updateNeeded |= bv().checkDepm(dummy, *this);
                        updateTextTargetOffset();
+                       if (updateNeeded)
+                               forceBufferUpdate();
                }
                return false;
        }
@@ -1906,7 +1912,7 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
                        ++dummy.pos();
                if (bv().checkDepm(dummy, old)) {
                        updateNeeded = true;
-                       // Make sure that cur gets back whatever happened to dummy(Lgb) 
+                       // Make sure that cur gets back whatever happened to dummy (Lgb) 
                        operator=(dummy);
                }
        } else {
@@ -1951,6 +1957,8 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
                updateNeeded |= bv().checkDepm(*this, old);
        }
 
+       if (updateNeeded)
+               forceBufferUpdate();
        updateTextTargetOffset();
        return true;
 }      
@@ -2112,13 +2120,31 @@ void Cursor::dispatched()
 }
 
 
-void Cursor::updateFlags(Update::flags f)
+void Cursor::screenUpdateFlags(Update::flags f)
 {
        disp_.update(f);
 }
 
 
-void Cursor::noUpdate()
+void Cursor::forceBufferUpdate()
+{
+       disp_.forceBufferUpdate();
+}
+
+
+void Cursor::clearBufferUpdate()
+{
+       disp_.clearBufferUpdate();
+}
+
+
+bool Cursor::needBufferUpdate() const
+{
+       return disp_.needBufferUpdate();
+}
+
+
+void Cursor::noScreenUpdate()
 {
        disp_.update(Update::None);
 }