summaryrefslogtreecommitdiff
path: root/src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-10-05 12:40:27 +0200
committerChristian Kamm <christian.d.kamm@nokia.com>2011-10-12 11:34:43 +0200
commit0c4bd321e5d6adf1d3ee365abd43a0d1a8683520 (patch)
tree75e07bdb6713e6b798f49e377c3acbc16e662a85 /src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp
parentb5a92a1957e930ac815679243c2f7e8e597dbbe0 (diff)
downloadqt-creator-0c4bd321e5d6adf1d3ee365abd43a0d1a8683520.tar.gz
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>
Diffstat (limited to 'src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp')
-rw-r--r--src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp b/src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp
index 4b809d89ee..412c4c9d83 100644
--- a/src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp
+++ b/src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp
@@ -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 {