]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathNest.C
* InsetMathNest.C (handleFont): avoid crash on undo when
[lyx.git] / src / mathed / InsetMathNest.C
index 30f5d845b29c853fccd3291ee9e05f31355c0723..367b4a65b743a143ad3eddb5e0ad90d01d7bbe63 100644 (file)
@@ -401,11 +401,12 @@ void InsetMathNest::handleFont
 {
        // this whole function is a hack and won't work for incremental font
        // changes...
-       recordUndo(cur, Undo::ATOMIC);
 
-       if (cur.inset().asInsetMath()->name() == font)
+       if (cur.inset().asInsetMath()->name() == font) {
+               recordUndoInset(cur, Undo::ATOMIC);
                cur.handleFont(to_utf8(font));
-       else {
+       } else {
+               recordUndo(cur, Undo::ATOMIC);
                cur.handleNest(createInsetMath(font));
                cur.insert(arg);
        }
@@ -983,6 +984,12 @@ void InsetMathNest::doDispatch(LCursor & cur, FuncRequest & cmd)
                interpretChar(cur, '^');
                break;
 
+       case LFUN_QUOTE_INSERT:
+               // interpret this as if a straight " was typed
+               recordUndo(cur, Undo::ATOMIC);
+               interpretChar(cur, '\"');
+               break;
+
 // FIXME: We probably should swap parts of "math-insert" and "self-insert"
 // handling such that "self-insert" works on "arbitrary stuff" too, and
 // math-insert only handles special math things like "matrix".