]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathNest.cpp
Kill macro mode when using LFUN_ESCAPE
[lyx.git] / src / mathed / InsetMathNest.cpp
index 8d7c110a4ab3c25717827f84f779bfbef73b2e03..a03aaefb168a38304e91042f1d076bc59d1a13bd 100644 (file)
@@ -813,8 +813,8 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cur.recordUndoSelection();
                // if the inset can not be removed from within, delete it
                if (!cur.backspace(cmd.getArg(0) == "force")) {
-                       FuncRequest cmd = FuncRequest(LFUN_CHAR_DELETE_FORWARD, "force");
-                       cur.innerText()->dispatch(cur, cmd);
+                       FuncRequest newcmd = FuncRequest(LFUN_CHAR_DELETE_FORWARD, "force");
+                       cur.innerText()->dispatch(cur, newcmd);
                }
                break;
 
@@ -827,8 +827,8 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cur.recordUndoSelection();
                // if the inset can not be removed from within, delete it
                if (!cur.erase(cmd.getArg(0) == "force")) {
-                       FuncRequest cmd = FuncRequest(LFUN_CHAR_DELETE_FORWARD, "force");
-                       cur.innerText()->dispatch(cur, cmd);
+                       FuncRequest newcmd = FuncRequest(LFUN_CHAR_DELETE_FORWARD, "force");
+                       cur.innerText()->dispatch(cur, newcmd);
                }
                break;
 
@@ -836,8 +836,12 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                if (cur.selection())
                        cur.clearSelection();
                else  {
-                       cmd = FuncRequest(LFUN_FINISHED_FORWARD);
-                       cur.undispatched();
+                       if (cur.inMacroMode())
+                               cur.macroModeClose(true);
+                       else {
+                               cmd = FuncRequest(LFUN_FINISHED_FORWARD);
+                               cur.undispatched();
+                       }
                }
                break;
 
@@ -896,7 +900,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                int y = 0;
                istringstream is(to_utf8(cmd.argument()));
                is >> x >> y;
-               cur.setScreenPos(x, y);
+               cur.setTargetX(x);
                break;
        }