From e4baf9e35938ce477c7e4aee5ff55369398973b4 Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Wed, 16 Mar 2011 11:10:41 +0100 Subject: [PATCH] Editors: Continue indent behavior change... For single line selection. Following 5e81630a2353f63543fc0cbae79575b2092669fa --- src/plugins/texteditor/basetexteditor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 16194911f0e..af61f7275b2 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -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()) {