Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
5ac981a0
Commit
5ac981a0
authored
Oct 19, 2010
by
Christian Kamm
Browse files
C++ indenter: Fix indentation after namespace aliases.
Task-number: QTCREATORBUG-2574 Reviewed-by: Roberto Raggi
parent
3c94a898
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppcodeformatter.cpp
View file @
5ac981a0
...
...
@@ -93,6 +93,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
case
namespace_start
:
switch
(
kind
)
{
case
T_LBRACE
:
enter
(
namespace_open
);
break
;
case
T_SEMICOLON
:
case
T_RBRACE
:
leave
();
break
;
}
break
;
...
...
tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp
View file @
5ac981a0
...
...
@@ -51,6 +51,7 @@ private Q_SLOTS:
void
forStatement
();
void
templateSingleline
();
void
macrosNoSemicolon2
();
void
renamedNamespace
();
};
struct
Line
{
...
...
@@ -985,6 +986,20 @@ void tst_CodeFormatter::macrosNoSemicolon2()
checkIndent
(
data
);
}
void
tst_CodeFormatter
::
renamedNamespace
()
{
QList
<
Line
>
data
;
data
<<
Line
(
"namespace X = Y;"
)
<<
Line
(
"void foo()"
)
<<
Line
(
"{"
)
<<
Line
(
" return;"
)
<<
Line
(
"}"
)
<<
Line
(
"int i;"
)
;
checkIndent
(
data
);
}
QTEST_APPLESS_MAIN
(
tst_CodeFormatter
)
#include
"tst_codeformatter.moc"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment