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>
This commit is contained in:
Christian Kandeler
2024-02-23 11:30:55 +01:00
parent feb70c1d7b
commit c0bbf285a7
2 changed files with 5 additions and 4 deletions

View File

@@ -1544,8 +1544,8 @@ void tst_CodeFormatter::indentNamespace()
<< Line("};")
<< Line("}")
<< Line("int j;")
<< Line("namespace {")
<< Line("namespace Foo {")
<< Line("inline namespace {")
<< Line("inline namespace Foo {")
<< Line("int j;")
<< Line("}")
<< Line("int j;")
@@ -1585,9 +1585,9 @@ void tst_CodeFormatter::indentNamespace2()
<< Line(" };")
<< Line("}")
<< Line("int j;")
<< Line("namespace {")
<< Line("inline namespace {")
<< Line(" int j;")
<< Line(" namespace Foo {")
<< Line(" inline namespace Foo {")
<< Line(" int j;")
<< Line(" }")
<< Line(" int j;")