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
3 changes: 1 addition & 2 deletions lib/rufo/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3405,9 +3405,8 @@ def skip_space_or_newline(_want_semicolon: false, write_first_semicolon: false)
if current_token_value.end_with?("\n")
write_space
write current_token_value.rstrip
write "\n"
write_line
write_indent(next_indent)
@column = next_indent
else
write current_token_value
end
Expand Down
19 changes: 19 additions & 0 deletions spec/lib/rufo/formatter_source_specs/junk_drawer.rb.spec
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,22 @@ end

def foo
end

#~# ORIGINAL issue 357 receiver preserved after comment in parens
a=(#X
1)

[STDOUT].each{ |elem| elem.puts [
2
]
}

#~# EXPECTED
a = ( #X
1)

[STDOUT].each { |elem|
elem.puts [
2,
]
}
Loading