Skip to content
Snippets Groups Projects
Commit 9eea942a authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlOutline: Fix reordering of array elements

Make sure that a comma is added when inserting array elements
into the array.

Task-number: QTCREATORBUG-2796
Reviewed-by: Erik Verbruggen
parent 3938cd67
No related branches found
No related tags found
No related merge requests found
......@@ -665,13 +665,13 @@ Rewriter::Range Rewriter::addObject(UiArrayBinding *ast, const QString &content,
QString textToInsert;
if (insertAfter && insertAfter->member) {
insertionPoint = insertAfter->member->lastSourceLocation().end();
textToInsert += QLatin1String("\n");
textToInsert = QLatin1String(",\n") + content;
} else {
insertionPoint = ast->lbracketToken.end();
textToInsert += QLatin1String("\n") + content + QLatin1Char(',');
}
textToInsert += content;
m_changeSet->insert(insertionPoint, QLatin1String("\n") + textToInsert);
m_changeSet->insert(insertionPoint, textToInsert);
return Range(insertionPoint, insertionPoint);
}
......
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