]> git.lyx.org Git - lyx.git/blobdiff - src/bufferview_funcs.C
don't rm emergency saves ever
[lyx.git] / src / bufferview_funcs.C
index 798ff2870a556862a363ff3fb2e7845285b0b238..a1782c0121d351f5c3f5fbe9a0a80bb5c7c0155e 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "frontends/LyXView.h"
 #include "frontends/Alert.h"
+#include "mathed/math_cursor.h"
 
 #include "support/lstrings.h"
 #include "Lsstream.h"
@@ -225,7 +226,6 @@ bool changeDepth(BufferView * bv, LyXText * text, DEPTH_CHANGE type, bool test_o
        if (test_only)
                return text->changeDepth(type, true);
 
-       bv->hideCursor();
        bv->update(BufferView::SELECT);
        bool const changed = text->changeDepth(type, false);
        if (text->inset_owner)
@@ -288,6 +288,9 @@ string const currentState(BufferView * bv)
        if (!bv->available())
                return string();
 
+       if (mathcursor)
+               return mathcursor->info();
+
        ostringstream state;
 
        LyXText * text = bv->getLyXText();
@@ -386,7 +389,6 @@ void toggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
        if (!text)
                return;
 
-       bv->hideCursor();
        bv->update(text, BufferView::SELECT);
        text->toggleFree(font, toggleall);
        bv->update(text, BufferView::SELECT);
@@ -396,7 +398,7 @@ void toggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
                LyXCursor & cursor = text->cursor;
                text->computeBidiTables(bv->buffer(), cursor.row());
                if (cursor.boundary() !=
-                   text->isBoundary(bv->buffer(), cursor.par(), cursor.pos(),
+                   text->isBoundary(bv->buffer(), *cursor.par(), cursor.pos(),
                                     text->real_current_font))
                        text->setCursor(cursor.par(), cursor.pos(),
                                        false, !cursor.boundary());