forked from qt-creator/qt-creator
QmlJS indenter: Never touch indent of multi-line strings.
Task-number: QTCREATORBUG-6368 Change-Id: Iae68427e429e625214bc0729aaaf313dc3371570 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
@@ -289,10 +289,8 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd
|
||||
}
|
||||
}
|
||||
|
||||
void QtStyleCodeFormatter::adjustIndent(const QList<Token> &tokens, int lexerState, int *indentDepth) const
|
||||
void QtStyleCodeFormatter::adjustIndent(const QList<Token> &tokens, int startLexerState, int *indentDepth) const
|
||||
{
|
||||
Q_UNUSED(lexerState)
|
||||
|
||||
State topState = state();
|
||||
State previousState = state(1);
|
||||
|
||||
@@ -304,6 +302,12 @@ void QtStyleCodeFormatter::adjustIndent(const QList<Token> &tokens, int lexerSta
|
||||
return;
|
||||
}
|
||||
}
|
||||
// don't touch multi-line strings at all
|
||||
if ((startLexerState & Scanner::MultiLineMask) == Scanner::MultiLineStringDQuote
|
||||
|| (startLexerState & Scanner::MultiLineMask) == Scanner::MultiLineStringSQuote) {
|
||||
*indentDepth = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
const int kind = extendedTokenKind(tokenAt(0));
|
||||
switch (kind) {
|
||||
|
||||
Reference in New Issue
Block a user