From 83c2be0da48489f1e99b839e50dbfe2edef4bd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 18 Apr 2002 15:29:27 +0000 Subject: [PATCH] fix enering of \_ git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4027 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formulabase.C | 2 +- src/mathed/math_cursor.C | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index de98c76ae9..bf01e56f3b 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -614,7 +614,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action, case LFUN_SUBSCRIPT: { bv->lockedInsetStoreUndo(Undo::EDIT); - mathcursor->script((action == LFUN_SUPERSCRIPT)); + mathcursor->script(action == LFUN_SUPERSCRIPT); updateLocal(bv, true); break; } diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 89fd224f7f..23c686e48f 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -1390,6 +1390,15 @@ bool MathCursor::interpret(string const & s) bool MathCursor::script(bool up) { + // Hack to get \\^ and \\_ working + if (inMacroMode() && macroName() == "\\") { + if (up) + interpret("\\mathcircumflex"); + else + interpret('_'); + return true; + } + macroModeClose(); selCut(); if (hasPrevAtom() && prevAtom()->asScriptInset()) {