]> git.lyx.org Git - features.git/commitdiff
Fix bug #7909: mark-on selection is lost during screen-down and screen-up
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 5 Dec 2011 08:35:55 +0000 (08:35 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 5 Dec 2011 08:35:55 +0000 (08:35 +0000)
The trick is to rely on Cursor::selHandle instead of fiddling with the selection

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

src/BufferView.cpp

index 8cea9baf1c510192c08278e8ccdcda8e76d83beb..a06b6fec4561d10a01bf02d006f931043d0d43d4 100644 (file)
@@ -1697,17 +1697,17 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        p = Point(width_, height_);
                Cursor old = cur;
                bool const in_texted = cur.inTexted();
-               cur.reset();
+               cur.setCursor(doc_iterator_begin(cur.buffer()));
+               cur.selHandle(false);
                buffer_.changed(true);
                updateHoveredInset();
 
                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();
-               if (update) {
+               if (update || cur.selection()) {
                        dr.screenUpdate(Update::Force | Update::FitCursor);
                        dr.forceBufferUpdate();
                }