* [sup-talk] [PATCH] add ask-before-quitting stuff
@ 2008-05-24 19:03 Lionel Ott
2008-05-25 2:07 ` William Morgan
0 siblings, 1 reply; 2+ messages in thread
From: Lionel Ott @ 2008-05-24 19:03 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [sup-talk] [PATCH] add ask-before-quitting stuff
2008-05-24 19:03 [sup-talk] [PATCH] add ask-before-quitting stuff Lionel Ott
@ 2008-05-25 2:07 ` William Morgan
0 siblings, 0 replies; 2+ messages in thread
From: William Morgan @ 2008-05-25 2:07 UTC (permalink / raw)
Applied to master, thanks!
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-25 2:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-24 19:03 [sup-talk] [PATCH] add ask-before-quitting stuff Lionel Ott
2008-05-25 2:07 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox