commit f8197778090e99e93d61548295a8ddf7d24ac967
parent 1e17e3a8a6e3c875780d6b61551048c336b469c9
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date: Sat, 27 Feb 2010 00:32:24 -0800
Merge branch 'master' into next
Diffstat:
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/sup.rb b/lib/sup.rb
@@ -265,7 +265,8 @@ else
:discard_snippets_from_encrypted_messages => false,
:default_attachment_save_dir => "",
:sent_source => "sup://sent",
- :poll_interval => 300
+ :poll_interval => 300,
+ :wrap_width => 0
}
begin
FileUtils.mkdir_p Redwood::BASE_DIR
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
@@ -810,7 +810,12 @@ private
if chunk.inlineable?
lines = chunk.lines
if @wrap
- width = buffer.content_width
+ config_width = $config[:wrap_width]
+ if config_width and config_width != 0
+ width = [config_width, buffer.content_width].min
+ else
+ width = buffer.content_width
+ end
lines = lines.map { |l| l.chomp.wrap width }.flatten
end
lines.map { |line| [[chunk.color, "#{prefix}#{line}"]] }