commit aabd2a52dc089d934adde55fe523508f27b4c159
parent 455f28fac6a436aa436402a817b20b7397e45359
Author: Per Andersson <avtobiff@gmail.com>
Date: Mon, 12 Aug 2013 12:42:45 +0200
Avoid crash when (maybe) wrapping text
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/thread_view_mode.rb b/lib/sup/modes/thread_view_mode.rb
@@ -846,6 +846,10 @@ private
else
width = buffer.content_width
end
+ # lines can apparently be both String and Array, convert to Array for map.
+ if lines.kind_of? String
+ lines = lines.lines.to_a
+ end
lines = lines.map { |l| l.chomp.wrap width if l }.flatten
end
return lines