forked from qt-creator/qt-creator
CppTools: Fix formatting for lambdas with trailing return type
After the arrow, the state is still the same, as now a type is expected. Only after the opening brace does the actual function start. Fixes: QTCREATORBUG-18497 Change-Id: I7bf18fbd6907d36f8869af3a78ad617cf0ee9dbb Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -273,7 +273,13 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
|
||||
case T_RBRACKET: // '[', ']' and '->' can be part of lambda declarator
|
||||
case T_LBRACKET:
|
||||
case T_ARROW: break;
|
||||
default: leave(); continue;
|
||||
default:
|
||||
if (m_tokenIndex > 0 && tokenAt(m_tokenIndex - 1).kind() == T_ARROW) {
|
||||
break;
|
||||
} else {
|
||||
leave();
|
||||
continue;
|
||||
}
|
||||
} break;
|
||||
|
||||
case lambda_declarator:
|
||||
|
||||
Reference in New Issue
Block a user