Commit 84344041 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Removed superfluous indenting while rewriting QML one-liners;

parent 36a9d8a4
......@@ -150,6 +150,7 @@ void AddPropertyVisitor::addInMembers(QmlJS::AST::UiObjectInitializer *initializ
newPropertyTemplate.prepend(QLatin1Char(' '));
if (needsTrailingSemicolon)
newPropertyTemplate.append(QLatin1Char(';'));
depth = 0;
} else {
newPropertyTemplate.prepend(QLatin1Char('\n'));
}
......
......@@ -98,6 +98,9 @@ unsigned QMLRewriter::calculateIndentDepth(const SourceLocation &position) const
QString QMLRewriter::addIndentation(const QString &text, unsigned depth)
{
if (depth == 0)
return text;
const QString indentation(depth, QLatin1Char(' '));
if (text.isEmpty())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment