Permalink
Browse files

Merge pull request #717 from lloeki/fix_multiline_object_coloring

Pry <#.*> coloring falls apart when it has multiple lines
  • Loading branch information...
2 parents 9c6bcb9 + b838e38 commit 24d9e486d75c3ec9a17e2ef2b1d88c119edf286f Robert Gleeson committed Sep 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/pry.rb
View
@@ -32,7 +32,7 @@ class Pry
colorized = Helpers::BaseHelpers.colorize_code(stringified.gsub(/#</, "%<#{nonce}"))
# avoid colour-leak from CodeRay and any of the users' previous output
- colorized = colorized.sub(/(\n*)$/, "\e[0m\\1") if Pry.color
+ colorized = colorized.sub(/(\n*)\z/, "\e[0m\\1") if Pry.color
Helpers::BaseHelpers.stagger_output("=> #{colorized.gsub(/%<(.*?)#{nonce}/, '#<\1')}", output)
end

0 comments on commit 24d9e48

Please sign in to comment.