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.removeSelectedText();
|
||||
|
||||
bool insertAtBeginningOfLine = ts.cursorIsAtBeginningOfLine(cursor);
|
||||
|
||||
@@ -4664,8 +4665,6 @@ void BaseTextEditor::insertFromMimeData(const QMimeData *source)
|
||||
return;
|
||||
}
|
||||
|
||||
cursor.removeSelectedText();
|
||||
|
||||
int reindentBlockStart = cursor.blockNumber() + (insertAtBeginningOfLine?0:1);
|
||||
|
||||
bool hasFinalNewline = (text.endsWith(QLatin1Char('\n'))
|
||||
|
||||
Reference in New Issue
Block a user