Subject: [sup-talk] [PATCH] add ask-before-quitting stuff

From: [email-masked] (Lionel Ott)
Date: Sat, 24 May 2008 21:03:26 +0200

old hotkey "q" now asks before quitting and "Q" quits immediately, the way
"q" used to work. ( should take care of
http://sup.rubyforge.org/ditz/issue-8aa7ea95f066fd0668452093b85903bd142905c9.html )
---
Hope the patch format is correct, as I've not really used git for anything
where I had to commit patches.
I mainly did this patch because in the beginning when using sup I constantly
tried to close buffers with q :-)

 bin/sup |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/bin/sup b/bin/sup
index 6360cde..723b1ed 100644
--- a/bin/sup
+++ b/bin/sup
@@ -55,7 +55,8 @@ Thread.abort_on_exception = true # make debugging possible
 module Redwood
 
 global_keymap = Keymap.new do |k|
-  k.add :quit, "Quit Redwood", 'q'
+  k.add :quit_ask, "Quit Sup, but ask first", 'q'
+  k.add :quit_now, "Quit Sup immediately", 'Q'
   k.add :help, "Show help", 'H', '?'
   k.add :roll_buffers, "Switch to next buffer", 'b'
 #  k.add :roll_buffers_backwards, "Switch to previous buffer", 'B'
@@ -240,8 +241,12 @@ begin
       end
 
     case action
-    when :quit
+    when :quit_now
       break if bm.kill_all_buffers_safely
+    when :quit_ask
+      if bm.ask_yes_or_no "Really quit?"
+        break if bm.kill_all_buffers_safely
+      end
     when :help
       curmode = bm.focus_buf.mode
       bm.spawn_unless_exists("<help for #{curmode.name}>") { HelpMode.new curmode, global_keymap }
-- 
1.5.5.1

---

From: [email-masked] (William Morgan)
Date: Sat, 24 May 2008 19:07:43 -0700

Applied to master, thanks!
-- 
William <wmorgan-sup at masanjin.net>