Skip to content

Commit f467028

Browse files
committed
Make Set#pretty_print IRB::ColorPrinter friendly
1 parent a9a82de commit f467028

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/set.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -822,13 +822,14 @@ def inspect
822822
alias to_s inspect
823823

824824
def pretty_print(pp) # :nodoc:
825-
pp.text sprintf('#<%s: {', self.class.name)
826-
pp.nest(1) {
827-
pp.seplist(self) { |o|
828-
pp.pp o
825+
pp.group(1, sprintf('#<%s:', self.class.name), '>') {
826+
pp.breakable
827+
pp.group(1, '{', '}') {
828+
pp.seplist(self) { |o|
829+
pp.pp o
830+
}
829831
}
830832
}
831-
pp.text "}>"
832833
end
833834

834835
def pretty_print_cycle(pp) # :nodoc:

0 commit comments

Comments
 (0)