forked from qt-creator/qt-creator
Editor: fix maybe select lines
Only select the lines if the cursor has no selection. If we have multiple cursors with a selection the user most probably want to copy or remove this selection. Fixes: QTCREATORBUG-26761 Change-Id: Idbf36a878e3d56ea34542b5de390c547bd8bcd6b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -6604,9 +6604,9 @@ void TextEditorWidget::focusOutEvent(QFocusEvent *e)
|
|||||||
|
|
||||||
void TextEditorWidgetPrivate::maybeSelectLine()
|
void TextEditorWidgetPrivate::maybeSelectLine()
|
||||||
{
|
{
|
||||||
if (q->textCursor().hasSelection() && !q->multiTextCursor().hasMultipleCursors())
|
|
||||||
return;
|
|
||||||
MultiTextCursor cursor = m_cursors;
|
MultiTextCursor cursor = m_cursors;
|
||||||
|
if (cursor.hasSelection())
|
||||||
|
return;
|
||||||
for (QTextCursor &c : cursor) {
|
for (QTextCursor &c : cursor) {
|
||||||
const QTextBlock &block = m_document->document()->findBlock(c.selectionStart());
|
const QTextBlock &block = m_document->document()->findBlock(c.selectionStart());
|
||||||
const QTextBlock &end = m_document->document()->findBlock(c.selectionEnd()).next();
|
const QTextBlock &end = m_document->document()->findBlock(c.selectionEnd()).next();
|
||||||
|
|||||||
Reference in New Issue
Block a user