From 15a2c54fc7e7c46ecef2103f303a02f7df6be13a Mon Sep 17 00:00:00 2001 From: wmorgan Date: Sun, 10 Dec 2006 19:11:40 +0000 Subject: [PATCH] improved handling of killing buffers. buffers now check with the mode (via #killable?) before killing. inbox-mode always returns false. also improved ask_yes_or_no. three outputs: yes, no, and nil (cancel). git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@68 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- bin/sup | 10 +++++---- lib/sup/buffer.rb | 10 ++++++++- lib/sup/mode.rb | 1 + lib/sup/modes/edit-message-mode.rb | 3 ++- lib/sup/modes/inbox-mode.rb | 2 ++ lib/sup/modes/resume-mode.rb | 33 +++++++++++++++++++----------- 6 files changed, 41 insertions(+), 18 deletions(-) diff --git a/bin/sup b/bin/sup index f8e50b7..003e8f5 100644 --- a/bin/sup +++ b/bin/sup @@ -132,7 +132,7 @@ begin when :roll_buffers_backwards bm.roll_buffers_backwards when :kill_buffer - bm.kill_buffer bm.focus_buf unless bm.focus_buf.mode.is_a? InboxMode + bm.kill_buffer bm.focus_buf if bm.focus_buf.mode.killable? when :list_buffers bm.spawn_unless_exists("Buffer List") { BufferListMode.new } when :list_contacts @@ -187,10 +187,12 @@ if $exception case $exception when IndexError $stderr.puts <