diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2024-02-23 11:30:55 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2024-02-23 13:46:04 +0000 |
commit | c0bbf285a7eecfbc461290042015e0b23db2909e (patch) | |
tree | 8490ceffe66a59c024c2da5ba2431df3c305d136 /src/plugins/cppeditor | |
parent | feb70c1d7b78a622586642223d93296ad63a8171 (diff) |
CppEditor: Fix indentation with inline namespaces
After encountering the namespace keyword, we have to backtrack the state
change introduced by the inline keyword.
Fixes: QTCREATORBUG-22071
Change-Id: I543976622d1a56b2c61d68da6ec3eee8b6d0d5b3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/cppeditor')
-rw-r--r-- | src/plugins/cppeditor/cppcodeformatter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cppcodeformatter.cpp b/src/plugins/cppeditor/cppcodeformatter.cpp index 6b30e78fa6..e0e22fc6fe 100644 --- a/src/plugins/cppeditor/cppcodeformatter.cpp +++ b/src/plugins/cppeditor/cppcodeformatter.cpp @@ -151,6 +151,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block) case T_OPERATOR: enter(operator_declaration); break; case T_GREATER_GREATER: break; case T_LBRACKET: break; + case T_NAMESPACE: leave(); enter(namespace_start); break; default: tryExpression(true); break; } break; |