Skip to content

Commit

Permalink
Better Node#pretty_print
Browse files Browse the repository at this point in the history
Respect the current indentation
  • Loading branch information
kddnewton committed Sep 19, 2023
1 parent fea02cf commit 068333e
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 068333e

Please sign in to comment.