Skip to content
Snippets Groups Projects
Commit 84344041 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Removed superfluous indenting while rewriting QML one-liners;

parent 36a9d8a4
No related branches found
No related tags found
No related merge requests found
...@@ -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())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment