Subject: [sup-talk] [PATCH] skip system buffers when rolling

From: [email-masked] (Rich Lane)
Date: Sun, 16 Aug 2009 12:35:59 -0700

---
 lib/sup/buffer.rb |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index b3a256f..3fd2fe4 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -237,14 +237,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
-- 
1.6.4

---

From: [email-masked] (William Morgan)
Date: Tue, 18 Aug 2009 10:36:27 -0700

Nice idea. Branch buffer-rolling, merged into next.
-- 
William <wmorgan-sup at masanjin.net>