diff --git a/fixtures/small/long_blockvar_actual.rb b/fixtures/small/long_blockvar_actual.rb index d85153de..ae6720a5 100644 --- a/fixtures/small/long_blockvar_actual.rb +++ b/fixtures/small/long_blockvar_actual.rb @@ -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! +} diff --git a/fixtures/small/long_blockvar_expected.rb b/fixtures/small/long_blockvar_expected.rb index 11f86030..7bc1006e 100644 --- a/fixtures/small/long_blockvar_expected.rb +++ b/fixtures/small/long_blockvar_expected.rb @@ -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! + } diff --git a/librubyfmt/src/format.rs b/librubyfmt/src/format.rs index 1ca6dc2b..7b74a7ff 100644 --- a/librubyfmt/src/format.rs +++ b/librubyfmt/src/format.rs @@ -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);