void MathCursor::macroModeClose()
{
void MathCursor::macroModeClose()
{
+ MathInset::difference_type const t = macroNamePos();
+ if (t == -1)
+ return;
- if (s.size()) {
- size_type old = pos();
- pos() -= s.size();
- array().erase(pos(), old);
+ array().erase(t, pos());
+ pos() = t;
+ if (s != "\\")
- if (name == "\\") {
- insert(c, LM_TC_TEX);
- macroModeClose();
- return true;
- }
-
- if (c == '\\')
- insert(c, LM_TC_TEX);
- else if (c != ' ')
- insert(c, lastcode_);
+ if (c != ' ')
+ interpret(c);