TextEditor: Fix indentation of last line in selection

On normal selection it should *not* be indented.
On block selection it should.

Task-number: QTCREATORBUG-15300
Change-Id: I40ca1c24c6e14d05ca3c2d92a7562aac0eabb4c7
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-12-01 13:57:22 +02:00
committed by Orgad Shaneh
parent 0d7f166b19
commit 48a2e15c28

View File

@@ -130,7 +130,7 @@ QTextCursor TextDocumentPrivate::indentOrUnindent(const QTextCursor &textCursor,
bool modified = true;
QTextBlock startBlock = m_document.findBlock(start);
QTextBlock endBlock = m_document.findBlock(end).next();
QTextBlock endBlock = m_document.findBlock(blockSelection ? end : end - 1).next();
const bool oneLinePartial = (startBlock.next() == endBlock)
&& (start > startBlock.position() || end < endBlock.position() - 1);