forked from qt-creator/qt-creator
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user