return;
}
- if (c == '{') {
- niceInsert(new MathScopeInset);
- return;
- }
-
- if (isalpha(c) && (lastcode_ == LM_TC_GREEK || lastcode_ == LM_TC_GREEK1)) {
- static char const greek[26] =
- {'A', 'B', 'X', 0 , 'E', 0 , 0 , 'H', 'I', 0 ,
- 'K', 0 , 'M', 'N', 'O', 0 , 0 , 'P', 0 , 'T',
- 0, 0, 0, 0, 0 , 'Z' };
-
- MathTextCodes code = LM_TC_SYMB;
- if ('A' <= c && c <= 'Z' && greek[c - 'A']) {
- code = LM_TC_RM;
- c = greek[c - 'A'];
- }
- insert(c, code);
-
-#warning greek insert problem? look here!
- //if (lastcode_ == LM_TC_GREEK1)
- lastcode_ = LM_TC_VAR;
- return;
- }
-
if (selection_)
selDel();
- if (lastcode_ == LM_TC_TEX) {
- if (macroName().empty()) {
- insert(c, LM_TC_TEX);
- if (!isalpha(c)) {
- macroModeClose();
- lastcode_ = LM_TC_VAR;
- }
- } else {
- if (isalpha(c))
- insert(c, LM_TC_TEX);
- else {
- macroModeClose();
- lastcode_ = LM_TC_VAR;
- }
- }
- return;
- }
-
- if (strchr("0123456789;:!|[]().,?+/-*<>=", c)) {
- if (lastcode_ != LM_TC_TEXTRM)
- lastcode_ = LM_TC_CONST;
- insert(c, lastcode_);
- return;
- }
-
- if (strchr("#$%{|}", c)) {
- if (lastcode_ != LM_TC_TEXTRM)
- lastcode_ = LM_TC_SPECIAL;
- insert(c, lastcode_);
+ if (lastcode_ == LM_TC_TEXTRM) {
+ insert(c, LM_TC_TEXTRM);
return;
}
return;
}
- if (lastcode_ == LM_TC_TEXTRM) {
- insert(c, LM_TC_TEXTRM);
- return;
- }
-
if (mathcursor->popRight())
return;
return;
}
- if (c == '\'' || c == '@') {
- insert(c, LM_TC_VAR);
+ if (lastcode_ == LM_TC_TEX) {
+ if (macroName().empty()) {
+ insert(c, LM_TC_TEX);
+ if (!isalpha(c)) {
+ macroModeClose();
+ lastcode_ = LM_TC_VAR;
+ }
+ } else {
+ if (isalpha(c))
+ insert(c, LM_TC_TEX);
+ else {
+ macroModeClose();
+ lastcode_ = LM_TC_VAR;
+ }
+ }
return;
}
- if (c == '\\') {
- lastcode_ = LM_TC_TEX;
- //bv->owner()->message(_("TeX mode"));
+ if (c == '{') {
+ niceInsert(new MathScopeInset);
+ return;
+ }
+
+ if (c == '}') // ignore it
+ return;
+
+ if (isalpha(c) && (lastcode_ == LM_TC_GREEK || lastcode_ == LM_TC_GREEK1)) {
+ static char const greek[26] =
+ {'A', 'B', 'X', 0 , 'E', 0 , 0 , 'H', 'I', 0 ,
+ 'K', 0 , 'M', 'N', 'O', 0 , 0 , 'P', 0 , 'T',
+ 0, 0, 0, 0, 0 , 'Z' };
+
+ MathTextCodes code = LM_TC_SYMB;
+ if ('A' <= c && c <= 'Z' && greek[c - 'A']) {
+ code = LM_TC_RM;
+ c = greek[c - 'A'];
+ }
+ insert(c, code);
+
+#warning greek insert problem? look here!
+ //if (lastcode_ == LM_TC_GREEK1)
+ lastcode_ = LM_TC_VAR;
return;
}
- if (isalpha(c)) {
- insert(c, lastcode_);
+ if (c == '\\') {
+ lastcode_ = LM_TC_TEX;
+ //bv->owner()->message(_("TeX mode"));
return;
}
+ // no special circumstances, so insert the character without any fuss
+ insert(c);
}