Skip to content

Commit

Permalink
Merge pull request #1552 from ruby/better-pretty-print
Browse files Browse the repository at this point in the history
Better Node#pretty_print
  • Loading branch information
kddnewton authored Sep 19, 2023
2 parents a3f5185 + 068333e commit 82f36a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/yarp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,10 @@ def slice
end

def pretty_print(q)
q.text(inspect.chomp)
q.seplist(inspect.chomp.each_line, -> { q.breakable }) do |line|
q.text(line.chomp)
end
q.current_group.break
end
end

Expand Down

0 comments on commit 82f36a1

Please sign in to comment.