forked from qt-creator/qt-creator
Editor: do not replace selection in drop editor
Only remove the selected text if the drag source is the editor and we want to move the selection. Fixes: QTCREATORBUG-28126 Change-Id: Iaa54d54c432df2da99e30ddb569e06e3ccd0df00 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -7665,7 +7665,7 @@ void TextEditorWidget::dropEvent(QDropEvent *e)
|
||||
MultiTextCursor cursor = multiTextCursor();
|
||||
cursor.beginEditBlock();
|
||||
const QTextCursor eventCursor = cursorForPosition(e->pos());
|
||||
if (e->dropAction() == Qt::MoveAction)
|
||||
if (e->dropAction() == Qt::MoveAction && e->source() == viewport())
|
||||
cursor.removeSelectedText();
|
||||
cursor.setCursors({eventCursor});
|
||||
setMultiTextCursor(cursor);
|
||||
|
Reference in New Issue
Block a user