]> git.lyx.org Git - features.git/blobdiff - src/Cursor.cpp
GuiView::dispatchToBufferView(): simplify code and move some to Cursor::dispatch().
[features.git] / src / Cursor.cpp
index c96762d5f774e79e9c11ffecac87b1bf5d5a61c6..d504670fa7fedb726d98df8b6ad5f57fc7bf0ac6 100644 (file)
@@ -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();
+       }
 }