forked from qt-creator/qt-creator
Editor: unselect text on mouse release event
Update the main cursor after calling QPlainTextEdit::mouseReleaseEvent. Calling that function might change the selection without changing the position, so it wont emit cursor position changed, and the multi cursor does not get updated properly. Task-number: QTCREATORBUG-26493 Change-Id: Ie310ee9a4c66897766af87065ee42fcd01302854 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -5245,6 +5245,14 @@ void TextEditorWidget::mouseReleaseEvent(QMouseEvent *e)
|
||||
return;
|
||||
|
||||
QPlainTextEdit::mouseReleaseEvent(e);
|
||||
|
||||
d->setClipboardSelection();
|
||||
const QTextCursor plainTextEditCursor = textCursor();
|
||||
const QTextCursor multiMainCursor = multiTextCursor().mainCursor();
|
||||
if (multiMainCursor.position() != plainTextEditCursor.position()
|
||||
|| multiMainCursor.anchor() != plainTextEditCursor.anchor()) {
|
||||
doSetTextCursor(plainTextEditCursor, true);
|
||||
}
|
||||
}
|
||||
|
||||
void TextEditorWidget::mouseDoubleClickEvent(QMouseEvent *e)
|
||||
|
Reference in New Issue
Block a user