Skip to content
Browse files

fixed height tracking bug (thanks to melborne) and version bump 0.6.2

  • Loading branch information...
1 parent 578d1c2 commit 7593afcf42eac479372f8f1d65ab9e982bb9711b @janlelis janlelis committed Nov 14, 2010
Showing with 6 additions and 3 deletions.
  1. +1 −1 VERSION
  2. +1 −1 fancy_irb.gemspec
  3. +4 −1 lib/fancy_irb.rb
View
2 VERSION
@@ -1 +1 @@
-0.6.1
+0.6.2
View
2 fancy_irb.gemspec
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{fancy_irb}
- s.version = "0.6.1"
+ s.version = "0.6.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jan Lelis"]
View
5 lib/fancy_irb.rb
@@ -105,7 +105,10 @@ def reset_height
def track_height(data)
lines = data.to_s.count("\n")
- long_lines = data.to_s.split("\n").inject(0){ |sum, line| line.size / `tput cols`.to_i }
+ long_lines = data.to_s.split("\n").inject(0){ |sum, line|
+ line_size = (RUBY_VERSION[2] == ?8) ? line.unpack('U*').size : line.size
+ sum + (line_size / `tput cols`.to_i)
+ }
@height_counter << lines + long_lines
end

0 comments on commit 7593afc

Please sign in to comment.
Something went wrong with that request. Please try again.