sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 1bc4fcb8ca70611b7d6d35dcae690d9ee62cd2f2
parent af4509909beb1cb175aa30fd6d24f43e334fa991
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Thu,  1 Feb 2007 21:27:21 +0000

progressively update display based on time rather than number of entries


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

Diffstat:
M lib/sup/modes/thread-index-mode.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -320,11 +320,13 @@ class ThreadIndexMode < LineCursorMode
   def load_n_threads n=LOAD_MORE_THREAD_NUM, opts={}
     @mbid = BufferManager.say "Searching for threads..."
     orig_size = @ts.size
+    last_update = Time.now
     @ts.load_n_threads(@ts.size + n, opts) do |i|
       BufferManager.say "Loaded #{i} threads...", @mbid
-      if i % 5 == 0
+      if (Time.now - last_update) >= 0.25
         update
         BufferManager.draw_screen
+        last_update = Time.now
       end
     end
     @ts.threads.each { |th| th.labels.each { |l| LabelManager << l } }