From: wmorgan Date: Tue, 3 Apr 2007 15:55:36 +0000 (+0000) Subject: better 'saving thread' messages X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=a1e3492d471e82ce775d017adfb9dd1ec4299328;p=sup better 'saving thread' messages git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@374 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index 68ee1ee..7bfb9ea 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -241,12 +241,12 @@ class ThreadIndexMode < LineCursorMode end def save - threads = @threads + @hidden_threads.keys + dirty_threads = (@threads + @hidden_threads.keys).select { |t| t.dirty? } + return if dirty_threads.empty? BufferManager.say("Saving threads...") do |say_id| - threads.each_with_index do |t, i| - next unless t.dirty? - BufferManager.say "Saving thread #{i +1} of #{threads.length}...", say_id + dirty_threads.each_with_index do |t, i| + BufferManager.say "Saving modified thread #{i + 1} of #{dirty_threads.length}...", say_id t.save Index end end