X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCursor.cpp;h=e08793c393f2ed8c88c2ffb615bfbd95094189d3;hb=225c1dbe55635a97b183909ea7194b8d92051378;hp=c96762d5f774e79e9c11ffecac87b1bf5d5a61c6;hpb=574931dcdb04f0b3be09dc7a2305611c5e88ed78;p=lyx.git diff --git a/src/Cursor.cpp b/src/Cursor.cpp index c96762d5f7..e08793c393 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -154,7 +154,7 @@ bool bruteFind(Cursor & cursor, else ++et.pit(); - double best_dist = numeric_limits::max();; + double best_dist = numeric_limits::max(); DocIterator best_cursor = et; for ( ; it != et; it.forwardPos(true)) { @@ -333,6 +333,7 @@ void Cursor::dispatch(FuncRequest const & cmd0) fixIfBroken(); FuncRequest cmd = cmd0; Cursor safe = *this; + Cursor old = *this; disp_ = DispatchResult(); buffer()->undo().beginUndoGroup(); @@ -393,6 +394,18 @@ void Cursor::dispatch(FuncRequest const & cmd0) 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(); + } }