mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
Fix array indentation as argument
This commit is contained in:
parent
6a24f0dc7c
commit
77e2ba4e3d
7 changed files with 26 additions and 0 deletions
|
@ -642,6 +642,9 @@ private:
|
|||
}
|
||||
else if (p == tok!"[" && config.dfmt_keep_line_breaks == OptionalBoolean.t)
|
||||
{
|
||||
if (peekBack2Is(tok!"(")) {
|
||||
indents.pop();
|
||||
}
|
||||
IndentStack.Details detail;
|
||||
|
||||
detail.wrap = false;
|
||||
|
|
6
tests/allman/keep_break_in_array_arg.d.ref
Normal file
6
tests/allman/keep_break_in_array_arg.d.ref
Normal file
|
@ -0,0 +1,6 @@
|
|||
unittest
|
||||
{
|
||||
f([
|
||||
x
|
||||
]);
|
||||
}
|
6
tests/keep_break_in_array_arg.d
Normal file
6
tests/keep_break_in_array_arg.d
Normal file
|
@ -0,0 +1,6 @@
|
|||
unittest
|
||||
{
|
||||
f([
|
||||
x
|
||||
]);
|
||||
}
|
1
tests/keep_break_in_array_chain.args
Normal file
1
tests/keep_break_in_array_chain.args
Normal file
|
@ -0,0 +1 @@
|
|||
--keep_line_breaks=true
|
5
tests/knr/keep_break_in_array_arg.d.ref
Normal file
5
tests/knr/keep_break_in_array_arg.d.ref
Normal file
|
@ -0,0 +1,5 @@
|
|||
unittest {
|
||||
f([
|
||||
x
|
||||
]);
|
||||
}
|
5
tests/otbs/keep_break_in_array_arg.d.ref
Normal file
5
tests/otbs/keep_break_in_array_arg.d.ref
Normal file
|
@ -0,0 +1,5 @@
|
|||
unittest {
|
||||
f([
|
||||
x
|
||||
]);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue