mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
Fix else indentation after debug conditions
This commit is contained in:
parent
72dd6e83b3
commit
6ff47e106a
4 changed files with 19 additions and 1 deletions
|
@ -732,13 +732,14 @@ private:
|
|||
writeToken();
|
||||
indents.popWrapIndents();
|
||||
linebreakHints = [];
|
||||
while (indents.topIsOneOf(tok!"enum", tok!"try", tok!"catch", tok!"finally"))
|
||||
while (indents.topIsOneOf(tok!"enum", tok!"try", tok!"catch", tok!"finally", tok!"debug"))
|
||||
indents.pop();
|
||||
if (indents.topAre(tok!"static", tok!"else"))
|
||||
{
|
||||
indents.pop();
|
||||
indents.pop();
|
||||
}
|
||||
indentLevel = indents.indentLevel;
|
||||
if (config.dfmt_brace_style == BraceStyle.allman)
|
||||
{
|
||||
if (!currentIs(tok!"{"))
|
||||
|
|
7
tests/allman/debug_with_param.d.ref
Normal file
7
tests/allman/debug_with_param.d.ref
Normal file
|
@ -0,0 +1,7 @@
|
|||
void main()
|
||||
{
|
||||
debug (0)
|
||||
foo();
|
||||
else
|
||||
bar();
|
||||
}
|
4
tests/debug_with_param.d
Normal file
4
tests/debug_with_param.d
Normal file
|
@ -0,0 +1,4 @@
|
|||
void main()
|
||||
{
|
||||
debug(0) foo(); else bar();
|
||||
}
|
6
tests/otbs/debug_with_param.d.ref
Normal file
6
tests/otbs/debug_with_param.d.ref
Normal file
|
@ -0,0 +1,6 @@
|
|||
void main() {
|
||||
debug (0)
|
||||
foo();
|
||||
else
|
||||
bar();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue