]> git.lyx.org Git - features.git/commitdiff
move selected part to script when pressing ^ or _
authorAndré Pönitz <poenitz@gmx.net>
Fri, 12 Oct 2001 13:05:21 +0000 (13:05 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 12 Oct 2001 13:05:21 +0000 (13:05 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2869 a592a061-630c-0410-9148-cb99ea01b6c8

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;