From: Jean-Marc Lasgouttes Date: Mon, 5 Dec 2011 08:35:55 +0000 (+0000) Subject: Fix bug #7909: mark-on selection is lost during screen-down and screen-up X-Git-Tag: 2.1.0beta1~2277 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9928a67e3224113d214de5e1e66d9de0a42fff59;p=features.git Fix bug #7909: mark-on selection is lost during screen-down and screen-up 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 --- diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 8cea9baf1c..a06b6fec45 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -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(); }