From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.213.28.69 with SMTP id l5cs63023ebc; Wed, 3 Feb 2010 12:23:51 -0800 (PST) Received: by 10.229.231.74 with SMTP id jp10mr115268qcb.56.1265228630620; Wed, 03 Feb 2010 12:23:50 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 4si4027825qwe.43.2010.02.03.12.23.50; Wed, 03 Feb 2010 12:23:50 -0800 (PST) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@googlemail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id DC74D18582E1; Wed, 3 Feb 2010 15:23:49 -0500 (EST) X-Greylist: delayed 415 seconds by postgrey-1.31 at rubyforge.org; Wed, 03 Feb 2010 15:23:32 EST Received: from mail-fx0-f219.google.com (mail-fx0-f219.google.com [209.85.220.219]) by rubyforge.org (Postfix) with ESMTP id CDC4718582BF for ; Wed, 3 Feb 2010 15:23:32 -0500 (EST) Received: by fxm19 with SMTP id 19so497370fxm.25 for ; Wed, 03 Feb 2010 12:23:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :message-id:x-mailer; bh=wsp7WHMpXddeqiIkqhuXt508mLYteoulBkI5PsCCBco=; b=bsZmmtiS1jPQIZ9weMFGVr/by5MHovf4ze79dRujraH5gDnG7jXDtyCuf5/IWnNSIE 4mF0NfxhwgrqNS706SH8D/86LhP1Q3aQ1csYvjTBmNdyGfOjrjGQTY6fZusofXt/P0FZ pSL0jQzS97FrXa24v1Rqnf5C/iRps0R+Zg5ks= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer; b=RYItdiyplewtQ6vsmIcnxsXHMhpoAPenEY0tVaXvSJk49lcespfuQWyoA3Zk3s8svG YxpSCC2h9WSpf2Qw4yLEvbOmpMIqvn2dwowpCSO+cDlrO1s164YpfJ9VsE/M5YFn2Tfv mPyFC3wIH91zJqxmw8U0gr/P8mCnxZpjqaBIk= Received: by 10.223.3.27 with SMTP id 27mr95825fal.8.1265228196719; Wed, 03 Feb 2010 12:16:36 -0800 (PST) Received: from localhost ([188.107.194.83]) by mx.google.com with ESMTPS id 16sm3391887fxm.12.2010.02.03.12.16.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Feb 2010 12:16:35 -0800 (PST) From: Daniel Schoepe To: sup-devel@rubyforge.org Date: Wed, 3 Feb 2010 21:16:35 +0100 Message-Id: <1265228195-4063-1-git-send-email-daniel.schoepe@googlemail.com> X-Mailer: git-send-email 1.6.6.1 Subject: [sup-devel] [PATCH] Add config option to limit text wrapping width X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org This patch adds a configuration `wrap_width' option to limit the width text wrapping uses(e.g. to wrap after 80 characters). --- lib/sup.rb | 3 ++- lib/sup/modes/thread-view-mode.rb | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/sup.rb b/lib/sup.rb index b9dc749..df85636 100644 --- a/lib/sup.rb +++ b/lib/sup.rb @@ -263,7 +263,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 index 0e935a4..e109a2d 100644 --- a/lib/sup/modes/thread-view-mode.rb +++ b/lib/sup/modes/thread-view-mode.rb @@ -792,7 +792,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}"]] } -- 1.6.6.1 _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel