sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit c7aa3fcad08082fa8d897349eb8d9b98735e0445
parent da1abd360e25011bdbe23b9194f926f29b8aef44
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Tue, 25 Aug 2009 09:53:04 -0400

Merge branch 'buffer-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
@@ -233,14 +233,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