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 ...@@ -150,6 +150,7 @@ void AddPropertyVisitor::addInMembers(QmlJS::AST::UiObjectInitializer *initializ
newPropertyTemplate.prepend(QLatin1Char(' ')); newPropertyTemplate.prepend(QLatin1Char(' '));
if (needsTrailingSemicolon) if (needsTrailingSemicolon)
newPropertyTemplate.append(QLatin1Char(';')); newPropertyTemplate.append(QLatin1Char(';'));
depth = 0;
} else { } else {
newPropertyTemplate.prepend(QLatin1Char('\n')); newPropertyTemplate.prepend(QLatin1Char('\n'));
} }
......
...@@ -98,6 +98,9 @@ unsigned QMLRewriter::calculateIndentDepth(const SourceLocation &position) const ...@@ -98,6 +98,9 @@ unsigned QMLRewriter::calculateIndentDepth(const SourceLocation &position) const
QString QMLRewriter::addIndentation(const QString &text, unsigned depth) QString QMLRewriter::addIndentation(const QString &text, unsigned depth)
{ {
if (depth == 0)
return text;
const QString indentation(depth, QLatin1Char(' ')); const QString indentation(depth, QLatin1Char(' '));
if (text.isEmpty()) 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