From: white.magic@gmx.de (Lionel Ott)
Subject: [sup-talk] [PATCH] add ask-before-quitting stuff
Date: Sat, 24 May 2008 21:03:26 +0200 [thread overview]
Message-ID: <1211655623-sup-5188@Hel> (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
next reply other threads:[~2008-05-24 19:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-24 19:03 Lionel Ott [this message]
2008-05-25 2:07 ` William Morgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1211655623-sup-5188@Hel \
--to=white.magic@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox