]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
partial fix for bug 6986: Use the right tex2lyx (at least if tex2lyx is installed)
[lyx.git] / src / Cursor.cpp
index c96762d5f774e79e9c11ffecac87b1bf5d5a61c6..e08793c393f2ed8c88c2ffb615bfbd95094189d3 100644 (file)
@@ -154,7 +154,7 @@ bool bruteFind(Cursor & cursor,
        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)) {
@@ -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();
+       }
 }