]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathNest.cpp
When inserting math inset over selection, place cursor better
[features.git] / src / mathed / InsetMathNest.cpp
index 35f28e95c03436f1fe656ab9318c69024bf452ed..857fd7f87e0fb3e7f2b39bed17159a00a6a6a723 100644 (file)
@@ -873,14 +873,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                        // via macro mode, we want to put the cursor inside it
                        // if relevant. Think typing "\frac<space>".
                        if (c == ' '
-                               && cur.inMacroMode() && cur.macroName() != "\\"
-                               && cur.macroModeClose() && cur.pos() > 0) {
-                               MathAtom const atom = cur.prevAtom();
-                               if (atom->asNestInset() && atom->isActive()) {
-                                       cur.posBackward();
-                                       cur.pushBackward(*cur.nextInset());
-                               }
-                       } else if (!interpretChar(cur, c)) {
+                           && cur.inMacroMode() && cur.macroName() != "\\"
+                           && cur.macroModeClose() && cur.pos() > 0)
+                               cur.editInsertedInset();
+                       else if (!interpretChar(cur, c)) {
                                cmd = FuncRequest(LFUN_FINISHED_FORWARD);
                                cur.undispatched();
                                // FIXME: can we avoid skipping the end of the string?