]> git.cworth.org Git - sup/commitdiff
skip system buffers when rolling
authorRich Lane <rlane@club.cc.cmu.edu>
Sun, 16 Aug 2009 19:35:59 +0000 (12:35 -0700)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 18 Aug 2009 17:34:45 +0000 (13:34 -0400)
lib/sup/buffer.rb

index 5f52d1dff53ab62f80c008a7a25b6a84505e308c..77a0e1e4685a2e87bb7695247ea50c3a8dd7c17a 100644 (file)
@@ -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