]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
some changes to make some compilers somewhat happier
[lyx.git] / src / lyxfunc.C
index 302aa2d1eca76a20b87681358d57dbd0e69fae18..90ef5d5c726bb37402e610414ac1346d024fa5ce 100644 (file)
@@ -559,8 +559,6 @@ func_status::value_type LyXFunc::getStatus(int ac,
        case LFUN_MATH_LIMITS: 
        case LFUN_MATH_NONUMBER: 
        case LFUN_MATH_NUMBER:
-       case LFUN_SUBSCRIPT:
-       case LFUN_SUPERSCRIPT:
                disable = !mathcursor;
                break;
 
@@ -725,7 +723,6 @@ func_status::value_type LyXFunc::getStatus(int ac,
                        break;
                }
        }
-#if 0
        else {
                MathTextCodes tc = mathcursor->getLastCode();
                switch (action) {
@@ -754,7 +751,6 @@ func_status::value_type LyXFunc::getStatus(int ac,
                        break;
                }
        }
-       #endif
        
        return flag;
 }
@@ -932,7 +928,6 @@ string const LyXFunc::dispatch(int ac,
        case LFUN_ESCAPE:
        {
                if (!owner->view()->available()) break;
-               
                // this function should be used always [asierra060396]
                UpdatableInset * tli =
                        owner->view()->theLockingInset();
@@ -949,6 +944,7 @@ string const LyXFunc::dispatch(int ac,
                                                        lock,
                                                        true);
                        }
+                       finishUndo();
                }
        }
        break;
@@ -1436,13 +1432,19 @@ string const LyXFunc::dispatch(int ac,
        case LFUN_MATH_NUMBER:
        case LFUN_MATH_NONUMBER:
        case LFUN_MATH_LIMITS:
-       case LFUN_SUBSCRIPT:
-       case LFUN_SUPERSCRIPT:
        {
                setErrorMessage(N_("This is only allowed in math mode!"));
        }
        break;
 
+       // passthrough hat and underscore outside mathed:
+       case LFUN_SUBSCRIPT:
+               dispatch(LFUN_SELFINSERT, "_");
+               break;
+       case LFUN_SUPERSCRIPT:
+               dispatch(LFUN_SELFINSERT, "^");
+               break;
+
        case LFUN_MATH_PANEL:
                owner->getDialogs()->showMathPanel();
                break;