]> git.lyx.org Git - features.git/commitdiff
fix math super/subscript
authorAndré Pönitz <poenitz@gmx.net>
Fri, 12 Dec 2003 13:57:20 +0000 (13:57 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 12 Dec 2003 13:57:20 +0000 (13:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8240 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/insetcommandparams.h
src/lyx_main.C
src/lyxfunc.C
src/mathed/formulabase.C
src/mathed/math_cursor.C

index a29dc5fa959b372e3471c93e746077078f1f1ee0..fd6b63d8202bd78c8bf0b188d975917d139c320a 100644 (file)
@@ -66,11 +66,9 @@ private:
 
 
 ///
-bool operator==(InsetCommandParams const &,
-               InsetCommandParams const &);
+bool operator==(InsetCommandParams const &, InsetCommandParams const &);
 
 ///
-bool operator!=(InsetCommandParams const &,
-               InsetCommandParams const &);
+bool operator!=(InsetCommandParams const &, InsetCommandParams const &);
 
 #endif
index eb5d7b0289d18ad3d593a9d5fab056cf04c095fd..53f614750ee59a75907cf2487365eb43b95093ec 100644 (file)
@@ -424,10 +424,6 @@ void LyX::defaultKeyBindings(kb_keymap  * kbmap)
        kbmap->bind("Delete", FuncRequest(LFUN_DELETE));
        kbmap->bind("BackSpace", FuncRequest(LFUN_BACKSPACE));
 
-       // sub- and superscript -MV
-       kbmap->bind("~S-underscore", FuncRequest(LFUN_SUBSCRIPT));
-       kbmap->bind("~S-asciicircum", FuncRequest(LFUN_SUPERSCRIPT));
-
        // kbmap->bindings to enable the use of the numeric keypad
        // e.g. Num Lock set
        //kbmap->bind("KP_0", FuncRequest(LFUN_SELFINSERT));
index e82bcafdcc5bea6080706b0ccc18bf88ad29bde2..015943c8906f99ea166af9b1f47ab53824d86377 100644 (file)
@@ -1193,15 +1193,6 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
                        setErrorMessage(N_("This is only allowed in math mode!"));
                        break;
 
-               // passthrough hat and underscore outside mathed:
-               case LFUN_SUBSCRIPT:
-                       dispatch(FuncRequest(view(), LFUN_SELFINSERT, "_"));
-                       break;
-
-               case LFUN_SUPERSCRIPT:
-                       dispatch(FuncRequest(view(), LFUN_SELFINSERT, "^"));
-                       break;
-
                case LFUN_DIALOG_SHOW: {
                        string const name = func.getArg(0);
                        string data = trim(func.argument.substr(name.size()));
index adba57c33cce48f23a5a5b71a743e705c225d48e..21f484afef5789874042bf37376e44414b57b5b6 100644 (file)
@@ -604,16 +604,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
                break;
        }
 
-       case LFUN_SUPERSCRIPT:
-       case LFUN_SUBSCRIPT:
-       {
-               recordUndo(bv, Undo::ATOMIC);
-               mathcursor->script(cmd.action == LFUN_SUPERSCRIPT);
-               break;
-       }
-
-       case LFUN_MATH_DELIM:
-       {
+       case LFUN_MATH_DELIM: {
                //lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'" << endl;
                string ls;
                string rs = split(cmd.argument, ls, ' ');
index 726fcce0b983b39638f0f1875c3b7d37b3a34a42..3f4cce319bfd9581f71871424aac9c0ea7e65ce0 100644 (file)
@@ -1254,6 +1254,16 @@ bool MathCursor::interpret(char c)
                return pos() != size();
        }
 
+       if (c == '_') {
+               script(false);
+               return true;
+       }
+
+       if (c == '^') {
+               script(true);
+               return true;
+       }
+
        if (c == '{' || c == '}' || c == '#' || c == '&' || c == '$') {
                niceInsert(createMathInset(string(1, c)));
                return true;