commit 8bdc9a223865aca217e7a9fa2af389111b790f69
parent 37b82db82623a76f888a361fa8077c01f3a16fba
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date: Wed, 28 Nov 2007 17:21:58 +0000
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
Diffstat:
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git 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