From 8bdc9a223865aca217e7a9fa2af389111b790f69 Mon Sep 17 00:00:00 2001 From: wmorgan Date: Wed, 28 Nov 2007 17:21:58 +0000 Subject: [PATCH] buffer killing & focusing bugfixes based on patch by Grant Hollingworth git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@733 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- lib/sup/buffer.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb index 609962c..e45046a 100644 --- a/lib/sup/buffer.rb +++ b/lib/sup/buffer.rb @@ -191,15 +191,13 @@ EOS end def raise_to_front buf - return unless @buffers.member? buf - - @buffers.delete buf + @buffers.delete(buf) or return if @buffers.length > 0 && @buffers.last.force_to_top? @buffers.insert(-2, buf) else @buffers.push buf - focus_on buf end + focus_on buf @dirty = true end @@ -387,10 +385,9 @@ EOS if @buffers.empty? ## TODO: something intelligent here ## for now I will simply prohibit killing the inbox buffer. + raise "how did you kill the inbox? that's impossible!" else - last = @buffers.last - @focus_buf ||= last - raise_to_front last + raise_to_front @buffers.last end end -- 2.45.2