sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit cd6e25d68d8b6766791a0a92195d701a81ebf95f
parent f0f5ce42ea561559356f4807998788dd825576c2
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Wed, 20 Jan 2010 11:27:38 -0500

Merge branch 'master' into next

Diffstat:
M bin/sup-sync | 2 +-
M lib/sup/modes/thread-index-mode.rb | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/bin/sup-sync b/bin/sup-sync
@@ -227,7 +227,7 @@ begin
         elapsed = last_info_time - start_time
         pctdone = source.respond_to?(:pct_done) ? source.pct_done : 100.0 * (source.cur_offset.to_f - source.start_offset).to_f / (source.end_offset - source.start_offset).to_f
         remaining = (100.0 - pctdone) * (elapsed.to_f / pctdone)
-        printf "## read %dm (about %.0f%%) @ %.1fm/s. %s elapsed, about %s remaining\n", num_scanned, pctdone, num_scanned / elapsed, elapsed.to_time_s, remaining.to_time_s
+        printf "## read %dm (~%.0f%%) @ %.1fm/s. %s elapsed, ~%s remaining, offset #{source.cur_offset}\n", num_scanned, pctdone, num_scanned / elapsed, elapsed.to_time_s, remaining.to_time_s
       end
     end
 
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -220,12 +220,14 @@ EOS
   end
 
   def update
+    old_cursor_thread = cursor_thread
     @mutex.synchronize do
       ## let's see you do THIS in python
       @threads = @ts.threads.select { |t| !@hidden_threads[t] }.sort_by { |t| [t.date, t.first.id] }.reverse
       @size_widgets = @threads.map { |t| size_widget_for_thread t }
       @size_widget_width = @size_widgets.max_of { |w| w.display_length }
     end
+    set_cursor_pos @threads.index(old_cursor_thread)||curpos
 
     regen_text
   end