forked from qt-creator/qt-creator
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:
committed by
Orgad Shaneh
parent
0d7f166b19
commit
48a2e15c28
@@ -130,7 +130,7 @@ QTextCursor TextDocumentPrivate::indentOrUnindent(const QTextCursor &textCursor,
|
|||||||
bool modified = true;
|
bool modified = true;
|
||||||
|
|
||||||
QTextBlock startBlock = m_document.findBlock(start);
|
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)
|
const bool oneLinePartial = (startBlock.next() == endBlock)
|
||||||
&& (start > startBlock.position() || end < endBlock.position() - 1);
|
&& (start > startBlock.position() || end < endBlock.position() - 1);
|
||||||
|
Reference in New Issue
Block a user