sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit a8e3572ee5ed91d205c2de0dd98cf8e610d04493
parent 5d70f7b458d0e3100be62c9bffee9a8dfd4c0f50
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Sun, 16 Aug 2009 12:35:59 -0700

skip system buffers when rolling

Diffstat:
M lib/sup/buffer.rb | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
@@ -230,14 +230,20 @@ EOS
   ## have to change this. but it's not clear that we will ever actually
   ## do that.
   def roll_buffers
-    @buffers.last.force_to_top = false
-    raise_to_front @buffers.first
+    bufs = rollable_buffers
+    bufs.last.force_to_top = false
+    raise_to_front bufs.first
   end
 
   def roll_buffers_backwards
-    return unless @buffers.length > 1
-    @buffers.last.force_to_top = false
-    raise_to_front @buffers[@buffers.length - 2]
+    bufs = rollable_buffers
+    return unless bufs.length > 1
+    bufs.last.force_to_top = false
+    raise_to_front bufs[bufs.length - 2]
+  end
+
+  def rollable_buffers
+    @buffers.select { |b| !b.system? || @buffers.last == b }
   end
 
   def handle_input c