From f67834bb2204ddc5709801d1d8c842ac770c1b95 Mon Sep 17 00:00:00 2001 From: Tommaso Cucinotta Date: Sun, 12 Jun 2011 01:19:07 +0000 Subject: [PATCH] Disabled possibility to type macros in regexp-mode. Now typing \ inserts a \ (no need to type twice) while in regexp mode. Addressing issue 4. at: http://permalink.gmane.org/gmane.editors.lyx.devel/136992 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39017 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathNest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 8e04e2a5d9..60c49b27b5 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1668,7 +1668,10 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c) bool reduced = cap::reduceSelectionToOneCell(cur); if (reduced || !cur.selection()) { docstring const safe = cap::grabAndEraseSelection(cur); - cur.insert(MathAtom(new InsetMathUnknown(from_ascii("\\"), safe, false))); + if (!cur.inRegexped()) + cur.insert(MathAtom(new InsetMathUnknown(from_ascii("\\"), safe, false))); + else + cur.niceInsert(createInsetMath("backslash", buf)); } return true; } -- 2.39.2