Json: Fix indenter for json files.

Change-Id: Id864509dd78a70fc34a3798b80f7e1c8991181f4
Reviewed-on: http://codereview.qt-project.org/6038
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
Christian Kamm
2011-10-05 12:40:27 +02:00
parent b5a92a1957
commit 0c4bd321e5
3 changed files with 32 additions and 0 deletions

View File

@@ -170,6 +170,9 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd
if (parentState.type == expression && state(1).type == binding_assignment) {
*savedIndentDepth = state(2).savedIndentDepth;
*indentDepth = *savedIndentDepth + m_indentSize;
} else if (parentState.type == objectliteral_assignment) {
*savedIndentDepth = parentState.savedIndentDepth;
*indentDepth = *savedIndentDepth + m_indentSize;
} else if (!lastToken) {
*indentDepth = tokenPosition + 1;
} else {