Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] skip system buffers when rolling
@ 2009-08-16 19:35 Rich Lane
  2009-08-18 17:36 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Rich Lane @ 2009-08-16 19:35 UTC (permalink / raw)


---
 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [sup-talk] [PATCH] skip system buffers when rolling
  2009-08-16 19:35 [sup-talk] [PATCH] skip system buffers when rolling Rich Lane
@ 2009-08-18 17:36 ` William Morgan
  0 siblings, 0 replies; 2+ messages in thread
From: William Morgan @ 2009-08-18 17:36 UTC (permalink / raw)


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-18 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-16 19:35 [sup-talk] [PATCH] skip system buffers when rolling Rich Lane
2009-08-18 17:36 ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox