]> git.lyx.org Git - features.git/blobdiff - src/mathed/math_cursor.C
move selected part to script when pressing ^ or _
[features.git] / src / mathed / math_cursor.C
index a89acb2933b2af9c044025b8e86a0880e5ac1ed5..0129b4531e1cb1acd309590e950579648cc38629 100644 (file)
@@ -1318,18 +1318,14 @@ void MathCursor::interpret(char c)
                        prevAtom()->asScriptInset()->ensure(up);
                        pushRight(prevAtom());
                        pos() = size();
-                       idx() = up;
-                       return;
-               }
-               if (hasNextAtom() && nextAtom()->asScriptInset()) {
+               } else if (hasNextAtom() && nextAtom()->asScriptInset()) {
                        nextAtom()->asScriptInset()->ensure(up);
                        pushLeft(nextAtom());
                        pos() = 0;
-                       idx() = up;
-                       return;
+               } else {
+                       plainInsert(MathAtom(new MathScriptInset(up)));
+                       pushRight(prevAtom());
                }
-               plainInsert(MathAtom(new MathScriptInset(up)));
-               pushRight(prevAtom());
                idx() = up;
                selPaste();
                return;