Am Donnerstag, 4. Januar 2007 18:52 schrieb Abdelrazak Younes:
> Bo Peng wrote:
>
> > I see that when I selection in nedit, lyx outputs 'lost selection'. So
> > there is a missing update. Abdel?
>
> This is not about painting at all. "Lost X selection" just means that
> LyX lost the token. The formally selected text should stay selected.
This is where people disagree. Some people want the selection to stay
selected (approach A), some people want that it is cleared (approach B).
> Thus, there is nothing to redraw.
That is not true: The implementation in LyX clearly follows approach B and
wants to clear the selection. Otherwise it would not call
cursor_.clearSelection() in BufferView::clearSelection().
The attached patch actually triggers the redraw. Can you please tell me
whether I did it right?
If we want to implement approach A we should not not call
cursor_.clearSelection() in BufferView::clearSelection(). The current code
is neither correct for approach A nor for B.
> > BTW, if paste, from an user's point view, always pastes from external,
> > what is the point of menu item "paste external clipboard/selection"?
> > If there is no objection, I am changing it to "paste special".
>
> Conceptually you're right. I would be OK with this change.
Me too.
Georg
Index: src/BufferView.C
===================================================================
--- src/BufferView.C (Revision 16510)
+++ src/BufferView.C (Arbeitskopie)
@@ -1016,6 +1017,8 @@ void BufferView::clearSelection()
if (buffer_) {
cursor_.clearSelection();
xsel_cache_.set = false;
+ update(Update::Force);
+ buffer_->changed();
}
}