]> git.lyx.org Git - features.git/blobdiff - src/BufferView.cpp
Rename anchor() to normalAnchor() as the anchor() function was already returning...
[features.git] / src / BufferView.cpp
index 672ac2f28013eb4a353db6362029228281a9e5d3..9a922f997febadca3a0f3e024287725fc775bdbc 100644 (file)
@@ -403,6 +403,11 @@ bool BufferView::fitCursor()
 
 void BufferView::processUpdateFlags(Update::flags flags)
 {
+       // last_inset_ points to the last visited inset. This pointer may become  
+       // invalid because of keyboard editing. Since all such operations  
+       // causes screen update(), I reset last_inset_ to avoid such a problem.  
+       d->last_inset_ = 0;  
+
        // This is close to a hot-path.
        LYXERR(Debug::DEBUG, "BufferView::processUpdateFlags()"
                << "[fitcursor = " << (flags & Update::FitCursor)
@@ -2253,7 +2258,7 @@ bool BufferView::mouseSetCursor(Cursor & cur, bool select)
                d->cursor_.fixIfBroken();
 
        // FIXME: shift-mouse selection doesn't work well across insets.
-       bool do_selection = select && &d->cursor_.anchor().inset() == &cur.inset();
+       bool do_selection = select && &d->cursor_.normalAnchor().inset() == &cur.inset();
 
        // do the dEPM magic if needed
        // FIXME: (1) move this to InsetText::notifyCursorLeaves?
@@ -2833,10 +2838,10 @@ void BufferView::setInlineCompletion(Cursor & cur, DocIterator const & pos,
        
        // set update flags
        if (changed) {
-               if (singlePar && !(cur.disp_.update() & Update::Force))
-                       cur.updateFlags(cur.disp_.update() | Update::SinglePar);
+               if (singlePar && !(cur.result().update() & Update::Force))
+                       cur.updateFlags(cur.result().update() | Update::SinglePar);
                else
-                       cur.updateFlags(cur.disp_.update() | Update::Force);
+                       cur.updateFlags(cur.result().update() | Update::Force);
        }
 }