Editors: Continue indent behavior change...

For single line selection. Following 5e81630a23
This commit is contained in:
Leandro Melo
2011-03-16 11:10:41 +01:00
parent 5e81630a23
commit e4baf9e359

View File

@@ -4363,7 +4363,9 @@ void BaseTextEditorWidget::indentOrUnindent(bool doIndent)
QTextBlock startBlock = doc->findBlock(start);
QTextBlock endBlock = doc->findBlock(end-1).next();
if (startBlock.next() == endBlock) { // Only one line selected
if (startBlock.next() == endBlock
&& (start > startBlock.position() || end < endBlock.position() - 1)) {
// Only one line partially selected.
cursor.removeSelectedText();
} else {
for (QTextBlock block = startBlock; block != endBlock; block = block.next()) {