apply insert-whole-lines magic only if the cursor is at the beginning

of the line.
This commit is contained in:
mae
2009-10-27 15:22:01 +01:00
parent 38d3ded832
commit 6526143626

View File

@@ -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();