diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 440acd8456d3e74d056266a12f11dfcb8a2642a8..e9beb84e1568d44b0083282e48c3e1dc30c910dc 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -4651,7 +4651,8 @@ void BaseTextEditor::insertFromMimeData(const QMimeData *source) || text.endsWith(QChar::ParagraphSeparator) || text.endsWith(QLatin1Char('\r'))); - if (hasFinalNewline) // since we'll add a final newline, preserve current line's indentation + if (insertAtBeginningOfLine + && hasFinalNewline) // since we'll add a final newline, preserve current line's indentation cursor.setPosition(cursor.block().position()); int cursorPosition = cursor.position();