From: wmorgan Date: Tue, 30 Oct 2007 15:58:30 +0000 (+0000) Subject: elide snippets X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=64bbef93f3401d808e9824773506ad601674ddaf;p=sup elide snippets git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@652 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index aba33df..493f90d 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -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