Fix auto-indentation when pasting into a selection

This commit is contained in:
mae
2009-11-09 15:55:47 +01:00
parent 7aa2411693
commit 55dbc39ed0

View File

@@ -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'))