forked from qt-creator/qt-creator
C++ editor: Put the changes for indenting a selection in an edit block.
Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -1563,11 +1563,14 @@ void CPPEditor::indent(QTextDocument *doc, const QTextCursor &cursor, QChar type
|
|||||||
CppTools::QtStyleCodeFormatter codeFormatter = setupCodeFormatter(ts);
|
CppTools::QtStyleCodeFormatter codeFormatter = setupCodeFormatter(ts);
|
||||||
codeFormatter.updateStateUntil(block);
|
codeFormatter.updateStateUntil(block);
|
||||||
|
|
||||||
|
QTextCursor tc = textCursor();
|
||||||
|
tc.beginEditBlock();
|
||||||
do {
|
do {
|
||||||
ts.indentLine(block, codeFormatter.indentFor(block));
|
ts.indentLine(block, codeFormatter.indentFor(block));
|
||||||
codeFormatter.updateLineStateChange(block);
|
codeFormatter.updateLineStateChange(block);
|
||||||
block = block.next();
|
block = block.next();
|
||||||
} while (block.isValid() && block != end);
|
} while (block.isValid() && block != end);
|
||||||
|
tc.endEditBlock();
|
||||||
} else {
|
} else {
|
||||||
indentBlock(doc, cursor.block(), typedChar);
|
indentBlock(doc, cursor.block(), typedChar);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user