forked from qt-creator/qt-creator
Fix auto-indentation when pasting into a selection
This commit is contained in:
@@ -4654,6 +4654,7 @@ void BaseTextEditor::insertFromMimeData(const QMimeData *source)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cursor.beginEditBlock();
|
cursor.beginEditBlock();
|
||||||
|
cursor.removeSelectedText();
|
||||||
|
|
||||||
bool insertAtBeginningOfLine = ts.cursorIsAtBeginningOfLine(cursor);
|
bool insertAtBeginningOfLine = ts.cursorIsAtBeginningOfLine(cursor);
|
||||||
|
|
||||||
@@ -4664,8 +4665,6 @@ void BaseTextEditor::insertFromMimeData(const QMimeData *source)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cursor.removeSelectedText();
|
|
||||||
|
|
||||||
int reindentBlockStart = cursor.blockNumber() + (insertAtBeginningOfLine?0:1);
|
int reindentBlockStart = cursor.blockNumber() + (insertAtBeginningOfLine?0:1);
|
||||||
|
|
||||||
bool hasFinalNewline = (text.endsWith(QLatin1Char('\n'))
|
bool hasFinalNewline = (text.endsWith(QLatin1Char('\n'))
|
||||||
|
|||||||
Reference in New Issue
Block a user