]> git.lyx.org Git - features.git/blobdiff - src/mathed/math_cursor.C
interpret a typed \#1 as math-macro-arg 0
[features.git] / src / mathed / math_cursor.C
index e0138f54bbef202efa3ccacdfc9b5053c48d2e28..454d2d416952948d677351aea9bcdbbcbc0e6dcc 100644 (file)
@@ -1283,18 +1283,23 @@ void MathCursor::interpret(string const & s)
 
        if (lastcode_ == LM_TC_TEX) {
                if (macroName().empty()) {
-                       if (strchr("#$%{}", c)) {
+                       if (strchr("$%{}", c)) {
                                insert(new MathCharInset(c, LM_TC_TEX));        
                                lastcode_ = LM_TC_VAR;
                                return;
                        }
                        insert(c, LM_TC_TEX);
-                       if (!isalpha(c)) {
+                       if (!isalpha(c) && c != '#') {
                                macroModeClose();
                                lastcode_ = LM_TC_VAR;
                        }
                } else {
-                       if (isalpha(c))
+                       if ('1' <= c && c <= '9' && macroName() == "#") {
+                               insert(c, LM_TC_TEX);
+                               macroModeClose();
+                               lastcode_ = LM_TC_VAR;
+                       }
+                       else if (isalpha(c))
                                insert(c, LM_TC_TEX);
                        else {
                                macroModeClose();