]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathNest.cpp
Record undo properly when inserting math script
[features.git] / src / mathed / InsetMathNest.cpp
index 8efa1181740653209fdd9757ec8c47895a223d42..2f4df74c00181a78060132d217bb09054e098f8f 100644 (file)
@@ -898,7 +898,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                if (cmd.argument().empty()) {
                        // do superscript if LyX handles
                        // deadkeys
-                       cur.recordUndoSelection();
+                       cur.recordUndoInset();
                        script(cur, true, grabAndEraseSelection(cur));
                }
                break;
@@ -1874,10 +1874,12 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
                return true;
        } else if (currentMode() != InsetMath::TEXT_MODE) {
                if (c == '_') {
+                       cur.recordUndoInset();
                        script(cur, false, save_selection);
                        return true;
                }
                if (c == '^') {
+                       cur.recordUndoInset();
                        script(cur, true, save_selection);
                        return true;
                }