#include "LaTeXFeatures.h"
#include "LyX.h"
#include "LyXRC.h"
-#include "Undo.h"
#include "frontends/Painter.h"
// look if there is no other macro in edit mode above
++i;
for (; i != cur.depth(); ++i) {
- MathMacro const * macro = dynamic_cast<MathMacro const *>(&cur[i].inset());
- if (macro && macro->displayMode() == DISPLAY_NORMAL)
- return false;
+ InsetMath * im = cur[i].asInsetMath();
+ if (im) {
+ MathMacro const * macro = im->asMacro();
+ if (macro && macro->displayMode() == DISPLAY_NORMAL)
+ return false;
+ }
}
// ok, none found, I am the highest one
// edit mode changed?
if (editing_[pi.base.bv] != editMode(pi.base.bv))
- pi.base.bv->cursor().updateFlags(Update::SinglePar);
+ pi.base.bv->cursor().screenUpdateFlags(Update::SinglePar);
}
void MathMacro::edit(Cursor & cur, bool front, EntryDirection entry_from)
{
- cur.updateFlags(Update::SinglePar);
+ cur.screenUpdateFlags(Update::SinglePar);
InsetMathNest::edit(cur, front, entry_from);
}
{
// We may have 0 arguments, but InsetMathNest requires at least one.
if (nargs() > 0) {
- cur.updateFlags(Update::SinglePar);
+ cur.screenUpdateFlags(Update::SinglePar);
return InsetMathNest::editXY(cur, x, y);
} else
return this;
bool MathMacro::idxFirst(Cursor & cur) const
{
- cur.updateFlags(Update::SinglePar);
+ cur.screenUpdateFlags(Update::SinglePar);
return InsetMathNest::idxFirst(cur);
}
bool MathMacro::idxLast(Cursor & cur) const
{
- cur.updateFlags(Update::SinglePar);
+ cur.screenUpdateFlags(Update::SinglePar);
return InsetMathNest::idxLast(cur);
}
inset_cursor.cell().erase(inset_cursor.pos());
inset_cursor.cell().insert(inset_cursor.pos(),
createInsetMath(unfolded_name, cur.buffer()));
- cur.updateFlags(cur.result().update() | Update::SinglePar);
+ cur.resetAnchor();
+ cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
return true;
}
}
- cur.updateFlags(Update::Force);
+ cur.screenUpdateFlags(Update::Force);
return InsetMathNest::notifyCursorLeaves(old, cur);
}
{
if (!nextFoldMode_) {
nextFoldMode_ = true;
- cur.updateFlags(Update::SinglePar);
+ cur.screenUpdateFlags(Update::SinglePar);
}
}
{
if (nextFoldMode_) {
nextFoldMode_ = false;
- cur.updateFlags(Update::SinglePar);
+ cur.screenUpdateFlags(Update::SinglePar);
}
}
docstring newName = name() + s;
asArray(newName, cell(0));
cur.bv().cursor().pos() = name().size();
- cur.updateFlags(Update::SinglePar);
+ cur.screenUpdateFlags(Update::SinglePar);
// finish macro
if (finished) {
cur.bv().cursor().pop();
++cur.bv().cursor().pos();
- cur.updateFlags(Update::SinglePar);
+ cur.screenUpdateFlags(Update::SinglePar);
}
return true;