]> git.cworth.org Git - sup/commitdiff
elide snippets
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Tue, 30 Oct 2007 15:58:30 +0000 (15:58 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Tue, 30 Oct 2007 15:58:30 +0000 (15:58 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@652 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/thread-index-mode.rb

index aba33df2ca7ed19ba721b7c99dce6dd7b8066d6e..493f90dd5a069d8e8b3f24dd9a27eaedfad0312f 100644 (file)
@@ -529,7 +529,7 @@ protected
     dp = t.direct_participants.any? { |p| AccountManager.is_account? p }
     p = dp || t.participants.any? { |p| AccountManager.is_account? p }
 
-    base_color =
+    subj_color =
       if new
         :index_new_color
       elsif starred
@@ -538,6 +538,8 @@ protected
         :index_old_color
       end
 
+    snippet = t.snippet + (t.snippet.empty? ? "" : "...")
+
     [ 
       [:tagged_color, @tags.tagged?(t) ? ">" : " "],
       [:none, sprintf("%#{@date_width}s", date)],
@@ -547,10 +549,10 @@ protected
       [
       [:none, t.size == 1 ? " " * (@size_width + 2) : sprintf("(%#{@size_width}d)", t.size)],
       [:to_me_color, dp ? " >" : (p ? ' +' : "  ")],
-      [base_color, t.subj + (t.subj.empty? ? "" : " ")],
+      [subj_color, t.subj + (t.subj.empty? ? "" : " ")],
     ] +
       (t.labels - @hidden_labels).map { |label| [:label_color, "+#{label} "] } +
-      [[:snippet_color, t.snippet]
+      [[:snippet_color, snippet]
     ]
 
   end