On Thu, Apr 14, 2011 at 09:53:46PM +0200, Peter Kuemmel wrote:
> This patch
> 
>     http://www.lyx.org/trac/attachment/ticket/7394/resetAnchor.patch
> 
> fixes the crash in
> 
>     http://www.lyx.org/trac/ticket/7394
> 
> But I don't know if it introduces any side effects.

This is not the correct fix, and neither is removing anchor_.clear().
For example, the assert is avoided but when you shift-click, the entire
document from the beginning gets selected and not from the cursor
position. Please, find attached the correct fix.

-- 
Enrico
Index: src/BufferView.cpp
===================================================================
--- src/BufferView.cpp  (revisione 38383)
+++ src/BufferView.cpp  (copia locale)
@@ -2190,6 +2190,8 @@ void BufferView::setCursorFromRow(int ro
                buffer_.text().setCursor(d->cursor_, 0, 0);
        else
                buffer_.text().setCursor(d->cursor_, 
buffer_.getParFromID(tmpid).pit(), tmppos);
+       d->cursor_.setSelection(false);
+       d->cursor_.resetAnchor();
        recenter();
 }
 

Reply via email to