Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions fixtures/small/long_blockvar_actual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,16 @@
|
do_things!
end

things.each { |
omg:,
really:,
dang:,
long:,
blockvar:,
that_is_so_long_if_you_write_this:,
you_should_refactor:,
like_really_this_is_so_long:
|
do_things!
}
14 changes: 14 additions & 0 deletions fixtures/small/long_blockvar_expected.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,17 @@
|
do_things!
end

things
.each { |
omg:,
really:,
dang:,
long:,
blockvar:,
that_is_so_long_if_you_write_this:,
you_should_refactor:,
like_really_this_is_so_long:
|
do_things!
}
4 changes: 3 additions & 1 deletion librubyfmt/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2650,7 +2650,9 @@ pub fn format_brace_block(ps: &mut ParserState, brace_block: BraceBlock) {

ps.inline_breakable_of(BreakableDelims::for_brace_block(), |ps| {
if let Some(bv) = bv {
format_blockvar(ps, bv);
ps.dedent(|ps| {
format_blockvar(ps, bv);
});
}

render_block_contents(ps, brace_block_render_method, body, end_line);
Expand Down