else
++et.pit();
- double best_dist = numeric_limits<double>::max();;
+ double best_dist = numeric_limits<double>::max();
DocIterator best_cursor = et;
for ( ; it != et; it.forwardPos(true)) {
fixIfBroken();
FuncRequest cmd = cmd0;
Cursor safe = *this;
+ Cursor old = *this;
disp_ = DispatchResult();
buffer()->undo().beginUndoGroup();
beforeDispatchCursor_ = safe.beforeDispatchCursor_;
}
buffer()->undo().endUndoGroup();
+
+ // notify insets we just left
+ if (*this != old) {
+ old.beginUndoGroup();
+ old.fixIfBroken();
+ bool badcursor = notifyCursorLeavesOrEnters(old, *this);
+ if (badcursor) {
+ fixIfBroken();
+ bv().fixInlineCompletionPos();
+ }
+ old.endUndoGroup();
+ }
}
namespace lyx {
-//#define FILEDEBUG 1
-
-
bool Cursor::isInside(Inset const * p) const
{
for (size_t i = 0; i != depth(); ++i)
{
if (!inMathed())
return false;
- if (pos() == 0)
+ if (pos() == 0 || cell().empty())
return false;
InsetMathUnknown const * p = prevAtom()->asUnknownInset();
return p && !p->final();
}
-void Cursor::undispatched()
+void Cursor::undispatched() const
{
disp_.dispatched(false);
}
-void Cursor::dispatched()
+void Cursor::dispatched() const
{
disp_.dispatched(true);
}
-void Cursor::screenUpdateFlags(Update::flags f)
+void Cursor::screenUpdateFlags(Update::flags f) const
{
disp_.screenUpdate(f);
}
-void Cursor::forceBufferUpdate()
+void Cursor::forceBufferUpdate() const
{
disp_.forceBufferUpdate();
}
-void Cursor::clearBufferUpdate()
+void Cursor::clearBufferUpdate() const
{
disp_.clearBufferUpdate();
}
}
-void Cursor::noScreenUpdate()
+void Cursor::noScreenUpdate() const
{
disp_.screenUpdate(Update::None);
}