]> git.lyx.org Git - features.git/commitdiff
Fix bug #7068 (Crash when pressing down arrow in an equation when there is a suggestion)
authorEnrico Forestieri <forenr@lyx.org>
Tue, 30 Nov 2010 03:54:29 +0000 (03:54 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 30 Nov 2010 03:54:29 +0000 (03:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36617 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/BufferView.h
src/frontends/qt4/GuiApplication.cpp

index 9f61d39825471c45b86e434261ee41cc5556b257..d973bbf83b7215840131078ec0b690e2a500c876 100644 (file)
@@ -2859,6 +2859,12 @@ DocIterator const & BufferView::inlineCompletionPos() const
 }
 
 
+bool BufferView::fixInlineCompletionPos()
+{
+       return d->inlineCompletionPos_.fixIfBroken();
+}
+
+
 bool samePar(DocIterator const & a, DocIterator const & b)
 {
        if (a.empty() && b.empty())
index 0672c9ddd16800c320dbd5bb8ae36ea8bb9ca6f1..c2ae8811d9d902a02ed6e6131b4c5b64c525809c 100644 (file)
@@ -190,6 +190,8 @@ public:
        size_t const & inlineCompletionUniqueChars() const;
        /// return the position in the buffer of the inline completion postfix.
        DocIterator const & inlineCompletionPos() const;
+       /// make sure inline completion position is OK
+       bool fixInlineCompletionPos();
        /// set the inline completion postfix and its position in the buffer.
        /// Updates the updateFlags in \c cur.
        void setInlineCompletion(Cursor & cur, DocIterator const & pos,
index 124e0baf382d7196c276bcb9a17a7f4adde9ca10..cedf1b2822a91f865fc6a5b5f3e939c4e648f1ad 100644 (file)
@@ -1652,8 +1652,10 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        old.beginUndoGroup();
                        old.fixIfBroken();
                        bool badcursor = notifyCursorLeavesOrEnters(old, bv->cursor());
-                       if (badcursor)
+                       if (badcursor) {
                                bv->cursor().fixIfBroken();
+                               bv->fixInlineCompletionPos();
+                       }
                        old.endUndoGroup();
                }