File tree 2 files changed +35
-26
lines changed
2 files changed +35
-26
lines changed Original file line number Diff line number Diff line change @@ -7210,36 +7210,17 @@ def format(q)
7210
7210
q . text ( " " )
7211
7211
q
7212
7212
. if_break do
7213
- force_parens =
7214
- q . parents . any? do |node |
7215
- node . is_a? ( Command ) || node . is_a? ( CommandCall )
7216
- end
7217
-
7218
- if force_parens
7219
- q . text ( "{" )
7213
+ q . text ( "do" )
7220
7214
7221
- unless statements . empty?
7222
- q . indent do
7223
- q . breakable_space
7224
- q . format ( statements )
7225
- end
7215
+ unless statements . empty?
7216
+ q . indent do
7226
7217
q . breakable_space
7218
+ q . format ( statements )
7227
7219
end
7228
-
7229
- q . text ( "}" )
7230
- else
7231
- q . text ( "do" )
7232
-
7233
- unless statements . empty?
7234
- q . indent do
7235
- q . breakable_space
7236
- q . format ( statements )
7237
- end
7238
- end
7239
-
7240
- q . breakable_space
7241
- q . text ( "end" )
7242
7220
end
7221
+
7222
+ q . breakable_space
7223
+ q . text ( "end" )
7243
7224
end
7244
7225
. if_flat do
7245
7226
q . text ( "{" )
Original file line number Diff line number Diff line change 80
80
-> do # comment1
81
81
# comment2
82
82
end
83
+ % # multiline lambda in a command
84
+ command "arg" do
85
+ -> {
86
+ multi
87
+ line
88
+ }
89
+ end
90
+ -
91
+ command "arg" do
92
+ -> do
93
+ multi
94
+ line
95
+ end
96
+ end
97
+ % # multiline lambda in a command call
98
+ command.call "arg" do
99
+ -> {
100
+ multi
101
+ line
102
+ }
103
+ end
104
+ -
105
+ command.call "arg" do
106
+ -> do
107
+ multi
108
+ line
109
+ end
110
+ end
You can’t perform that action at this time.
0 commit comments