]> git.lyx.org Git - features.git/commitdiff
Fix some more bugs similar to #7394, just fixed by Enrico.
authorRichard Heck <rgheck@comcast.net>
Fri, 15 Apr 2011 02:01:28 +0000 (02:01 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 15 Apr 2011 02:01:28 +0000 (02:01 +0000)
The one remaining question is whether we should also call resetAnchor()
at the end of setCursor().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38388 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp

index 3c3c74c417a286d55cfb9de69459e58371541637..97c44e6bf70398c7ac532f5058a205323d0248ff 100644 (file)
@@ -1456,6 +1456,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                buffer_.text().cursorBottom(cur);
                // accept everything in a single step to support atomic undo
                buffer_.text().acceptOrRejectChanges(cur, Text::ACCEPT);
+               cur.resetAnchor();
                // FIXME: Move this LFUN to Buffer so that we don't have to do this:
                dr.screenUpdate(Update::Force | Update::FitCursor);
                dr.forceBufferUpdate();
@@ -1469,6 +1470,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                // reject everything in a single step to support atomic undo
                // Note: reject does not work recursively; the user may have to repeat the operation
                buffer_.text().acceptOrRejectChanges(cur, Text::REJECT);
+               cur.resetAnchor();
                // FIXME: Move this LFUN to Buffer so that we don't have to do this:
                dr.screenUpdate(Update::Force | Update::FitCursor);
                dr.forceBufferUpdate();
@@ -1681,6 +1683,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
 
                d->text_metrics_[&buffer_.text()].editXY(cur, p.x_, p.y_,
                        true, act == LFUN_SCREEN_UP); 
+               cur.resetAnchor();
                //FIXME: what to do with cur.x_target()?
                bool update = in_texted && cur.bv().checkDepm(cur, old);
                cur.finishUndo();