From c0e2c0cd5c91aa7a30def62417aecb6f9d0a445e Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Wed, 27 Feb 2008 10:46:38 +0000 Subject: [PATCH] * better fix for * math commands. We allow the * for known math commands and for known math macros which are valid at that point in the buffer. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23273 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathNest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 73df673861..b56dd16efa 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1333,7 +1333,12 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type c) return true; } - if (isAlphaASCII(c) || c == '*') { + // do not finish macro for known * commands + MathWordList const & mwl = mathedWordList(); + bool star_macro = c == '*' + && (mwl.find(name.substr(1) + "*") != mwl.end() + || cur.buffer().getMacro(name.substr(1) + "*", cur, true)); + if (isAlphaASCII(c) || star_macro) { cur.activeMacro()->setName(name + docstring(1, c)); return true; }