lib/sup/modes/thread-index-mode.rb in sup-0.0.7 vs lib/sup/modes/thread-index-mode.rb in sup-0.0.8

- old
+ new

@@ -54,16 +54,12 @@ load_threads :num => buffer.content_height end ## open up a thread view window def select t=nil - t ||= @threads[curpos] + t ||= @threads[curpos] or return - ## this isn't working entirely. TODO:figure out why - # t = t.clone # required so that messages added later on don't completely - # screw everything up - ## TODO: don't regen text completely Redwood::reporting_thread do BufferManager.say("Loading message bodies...") do |sid| t.each { |m, *o| m.load_from_source! if m } end @@ -72,10 +68,14 @@ BufferManager.draw_screen mode.jump_to_first_open BufferManager.draw_screen # lame TODO: make this unnecessary ## the first draw_screen is needed before topline and botline ## are set, and the second to show the cursor having moved + + t.remove_label :unread + update_text_for_line curpos + UpdateManager.relay self, :read, t end end def multi_select threads threads.each { |t| select t } @@ -273,10 +273,10 @@ end def apply_to_tagged; @tags.apply_to_tagged; end def edit_labels - thread = @threads[curpos] + thread = @threads[curpos] or return speciall = (@hidden_labels + LabelManager::RESERVED_LABELS).uniq keepl, modifyl = thread.labels.partition { |t| speciall.member? t } label_string = modifyl.join(" ") label_string += " " unless label_string.empty?