From 1d1260a3aa6d6bb28fb9476859d268547d271382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 12 Nov 2001 08:20:30 +0000 Subject: [PATCH] interpret INSET_ERT as 'backslash pressed' to enable the use of the toolbar tex button within mathed... not that anybody would use it... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3005 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formula.C | 4 +++- src/mathed/formulabase.C | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 2a4d0e054d..af74148b79 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -565,7 +565,9 @@ void InsetFormula::validate(LaTeXFeatures & features) const bool InsetFormula::insetAllowed(Inset::Code code) const { - return code == Inset::LABEL_CODE && display(); + return + (code == Inset::LABEL_CODE && display()) + || code == Inset::ERT_CODE; } diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index f30b6ecbc7..a7a24cd2f5 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -582,6 +582,13 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action, //lyxerr << "LFUN ignored\n"; break; + case LFUN_INSET_ERT: + // interpret this as if a backslash was typed + bv->lockedInsetStoreUndo(Undo::EDIT); + mathcursor->interpret("\\"); + updateLocal(bv, true); + break; + case -1: case LFUN_INSERT_MATH: case LFUN_SELFINSERT: