Cursor old = *this;
disp_ = DispatchResult();
- buffer()->undo().beginUndoGroup();
+ beginUndoGroup();
// Is this a function that acts on inset at point?
if (lyxaction.funcHasFlag(cmd.action(), LyXAction::AtPoint)
<< cmd0 << endl << *this);
nextInset()->dispatch(*this, tmpcmd);
if (disp_.dispatched()) {
- buffer()->undo().endUndoGroup();
+ endUndoGroup();
return;
}
}
// are possible which would change it
beforeDispatchCursor_ = safe.beforeDispatchCursor_;
}
- buffer()->undo().endUndoGroup();
+ endUndoGroup();
// notify insets we just left
if (*this != old) {
}
-void Cursor::markEditPosition()
+void Cursor::markNewWordPosition()
{
if (lyxrc.spellcheck_continuously && inTexted() && new_word_.empty()) {
- FontSpan ow = locateWord(WHOLE_WORD);
- if (ow.size() == 1) {
+ FontSpan nw = locateWord(WHOLE_WORD);
+ if (nw.size() == 1) {
LYXERR(Debug::DEBUG, "start new word: "
<< " par: " << pit()
- << " pos: " << ow.first);
+ << " pos: " << nw.first);
new_word_ = *this;
}
}
docstring const name = s.substr(1);
InsetMathNest * const in = inset().asInsetMath()->asNestInset();
- if (in && in->interpretString(*this, s))
+ if (in && in->interpretString(*this, s)) {
+ // end undo group that was opened before in was created
+ endUndoGroup();
return true;
+ }
MathAtom atom = buffer()->getMacro(name, *this, false) ?
MathAtom(new MathMacro(buffer(), name)) : createInsetMath(name, buffer());
else
insert(selection);
}
-
+
+ // end undo group that was opened before in was created
+ endUndoGroup();
return true;
}
updateNeeded |= bv().checkDepm(dummy, *this);
updateTextTargetOffset();
- if (updateNeeded)
+ if (updateNeeded) {
forceBufferUpdate();
+ // DEPM may have requested a screen update
+ this->screenUpdateFlags(
+ this->screenUpdate() | dummy.screenUpdate());
+ }
}
return false;
}
++dummy.pos();
if (bv().checkDepm(dummy, old)) {
updateNeeded = true;
- // Make sure that cur gets back whatever happened to dummy (Lgb)
+ // Make sure that cur gets back whatever happened to dummy (Lgb)
+ // This will include any screen update requested by DEPM
operator=(dummy);
}
} else {
void Cursor::endUndoGroup() const
{
- buffer()->undo().endUndoGroup();
+ buffer()->undo().endUndoGroup(*this);
}