Fix bug #7068 (Crash when pressing down arrow in an equation when there is a suggestion)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36617 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2010-11-30 03:54:29 +00:00
parent 0612d77267
commit eb2600483a
3 changed files with 11 additions and 1 deletions

View 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) bool samePar(DocIterator const & a, DocIterator const & b)
{ {
if (a.empty() && b.empty()) if (a.empty() && b.empty())

View File

@ -190,6 +190,8 @@ public:
size_t const & inlineCompletionUniqueChars() const; size_t const & inlineCompletionUniqueChars() const;
/// return the position in the buffer of the inline completion postfix. /// return the position in the buffer of the inline completion postfix.
DocIterator const & inlineCompletionPos() const; DocIterator const & inlineCompletionPos() const;
/// make sure inline completion position is OK
bool fixInlineCompletionPos();
/// set the inline completion postfix and its position in the buffer. /// set the inline completion postfix and its position in the buffer.
/// Updates the updateFlags in \c cur. /// Updates the updateFlags in \c cur.
void setInlineCompletion(Cursor & cur, DocIterator const & pos, void setInlineCompletion(Cursor & cur, DocIterator const & pos,

View File

@ -1652,8 +1652,10 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
old.beginUndoGroup(); old.beginUndoGroup();
old.fixIfBroken(); old.fixIfBroken();
bool badcursor = notifyCursorLeavesOrEnters(old, bv->cursor()); bool badcursor = notifyCursorLeavesOrEnters(old, bv->cursor());
if (badcursor) if (badcursor) {
bv->cursor().fixIfBroken(); bv->cursor().fixIfBroken();
bv->fixInlineCompletionPos();
}
old.endUndoGroup(); old.endUndoGroup();
} }