From 4da53fd3a7a08d80b0b63640a6351dd4d1250b72 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 19 Sep 2023 12:30:48 -0400 Subject: [PATCH] [ruby/yarp] Better Node#pretty_print Respect the current indentation https://github.com/ruby/yarp/commit/068333ef49 --- lib/yarp.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/yarp.rb b/lib/yarp.rb index 28f0fae003..ed1bb685c2 100644 --- a/lib/yarp.rb +++ b/lib/yarp.rb @@ -307,7 +307,10 @@ module YARP 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