forked from qt-creator/qt-creator
Editor: Fix whitespace cleaning.
Task-number: QTCREATORBUG-7994 Change-Id: I6c197ccc3a148555018e8f8184d116c88d7ea400 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -58,13 +58,13 @@ void Indenter::indentBlock(QTextDocument *doc,
|
||||
{
|
||||
Q_UNUSED(doc)
|
||||
|
||||
QmlJSTools::CreatorCodeFormatter codeFormatter(tabSettings);
|
||||
|
||||
codeFormatter.updateStateUntil(block);
|
||||
const int depth = codeFormatter.indentFor(block);
|
||||
const int depth = indentFor(block, tabSettings);
|
||||
if (depth == -1)
|
||||
return;
|
||||
|
||||
QmlJSTools::CreatorCodeFormatter codeFormatter(tabSettings);
|
||||
codeFormatter.updateStateUntil(block);
|
||||
|
||||
if (isElectricCharacter(typedChar)) {
|
||||
// only reindent the current line when typing electric characters if the
|
||||
// indent is the same it would be if the line were empty
|
||||
@@ -81,3 +81,12 @@ void Indenter::invalidateCache(QTextDocument *doc)
|
||||
QmlJSTools::CreatorCodeFormatter codeFormatter;
|
||||
codeFormatter.invalidateCache(doc);
|
||||
}
|
||||
|
||||
|
||||
int Indenter::indentFor(const QTextBlock &block,
|
||||
const TextEditor::TabSettings &tabSettings)
|
||||
{
|
||||
QmlJSTools::CreatorCodeFormatter codeFormatter(tabSettings);
|
||||
codeFormatter.updateStateUntil(block);
|
||||
return codeFormatter.indentFor(block);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user