]> git.notmuchmail.org Git - sup/commitdiff
Merge branch 'buffer-rolling'
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 25 Aug 2009 13:53:04 +0000 (09:53 -0400)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 25 Aug 2009 13:53:04 +0000 (09:53 -0400)
lib/sup/buffer.rb

index 4b53fed697b037656cdec013a64da1bb5e78f59c..d85090a6db57eab56a8e230a6aeb8e3a925e6339 100644 (file)
@@ -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