Author: lasgouttes
Date: Mon Dec 5 09:35:55 2011
New Revision: 40372
URL: http://www.lyx.org/trac/changeset/40372
Log:
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
Modified:
lyx-devel/trunk/src/BufferView.cpp
Modified: lyx-devel/trunk/src/BufferView.cpp
==============================================================================
--- lyx-devel/trunk/src/BufferView.cpp Mon Dec 5 02:13:59 2011 (r40371)
+++ lyx-devel/trunk/src/BufferView.cpp Mon Dec 5 09:35:55 2011 (r40372)
@@ -1697,17 +1697,17 @@
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();
}