sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 320609c08675d823e214c8dfed5296d292ac72b4
parent bddd6646d7547b812d427d45f3b0aeefcefc1fba
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Wed, 20 Dec 2006 19:46:13 +0000

small gui improvements, mostly involving snippets


git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@89 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M lib/sup/message.rb | 7 ++-----
M lib/sup/modes/thread-index-mode.rb | 6 +++---
M lib/sup/modes/thread-view-mode.rb | 2 +-
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -297,13 +297,10 @@ private
  
       if state == :text && (@snippet.nil? || @snippet.length < SNIPPET_LEN) &&
           line !~ /[=\*#_-]{3,}/ && line !~ /^\s*$/
-        @snippet = (@snippet ? @snippet + " " : "") + line.gsub(/^\s+/, "").gsub(/[\r\n]/, "").gsub(/\s+/, " ")
+        @snippet += " " unless @snippet.empty?
+        @snippet += line.gsub(/^\s+/, "").gsub(/[\r\n]/, "").gsub(/\s+/, " ")
         @snippet = @snippet[0 ... SNIPPET_LEN]
       end
-#      if @snippet.nil? && state == :text && (line.length > 40 ||
-#                                             line =~ /\S+.*[^,!:]\s*$/)
-#        @snippet = line.gsub(/^\s+/, "").gsub(/[\r\n]/, "")[0 .. 80]
-#      end
     end
 
     ## final object
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -360,10 +360,10 @@ protected
       [:starred_color, starred ? "*" : " "],
       [:none, t.size == 1 ? " " * (@size_width + 2) : sprintf("(%#{@size_width}d)", t.size)],
       [:to_me_color, dp ? " >" : (p ? ' -' : "  ")],
-      [base_color, t.subj]
+      [base_color, t.subj + (t.subj.empty? ? "" : " ")],
     ] +
-      (t.labels - @hidden_labels).map { |label| [:label_color, " +#{label}"] } +
-      [[:snippet_color, " " + t.snippet]
+      (t.labels - @hidden_labels).map { |label| [:label_color, "+#{label} "] } +
+      [[:snippet_color, t.snippet]
     ]
   end
 
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
@@ -281,7 +281,7 @@ private
     when :open
       [[prefix_widget, widget, imp_widget,
         [:message_patina_color, 
-            "#{m.from ? m.from.mediumname : '?'} to #{m.to.map { |l| l.shortname }.join(', ')} #{m.date.to_nice_s} (#{m.date.to_nice_distance_s})"]]]
+            "#{m.from ? m.from.mediumname : '?'} to #{m.recipients.map { |l| l.shortname }.join(', ')} #{m.date.to_nice_s} (#{m.date.to_nice_distance_s})"]]]
 #        (m.to.empty? ? [] : [[[:message_patina_color, prefix + "    To: " + m.recipients.map { |x| x.mediumname }.join(", ")]]]) +
     when :closed
       [[prefix_widget, widget, imp_widget,