]> git.notmuchmail.org Git - sup/commitdiff
minor code cleanups
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sat, 10 Feb 2007 18:40:51 +0000 (18:40 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sat, 10 Feb 2007 18:40:51 +0000 (18:40 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@315 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/buffer.rb
lib/sup/mode.rb

index 0e2b85bce1bad619e41dd84144b901d41db57fad..d4fe54963eed56c1340f594d1ce0cf013558519d 100644 (file)
@@ -359,9 +359,9 @@ class BufferManager
     ret
   end
 
+  ## returns true (y), false (n), or nil (ctrl-g / cancel)
   def ask_yes_or_no question
-    r = ask_getch(question, "ynYN")
-    case r
+    case(r = ask_getch question, "ynYN")
     when ?y, ?Y
       true
     when nil
@@ -399,6 +399,7 @@ class BufferManager
 
   def say s, id=nil
     new_id = nil
+
     @minibuf_mutex.synchronize do
       new_id = id.nil?
       id ||= @minibuf_stack.length
index 88227e9c4a69bd1686aaccaf7410f21b5e50225e..640fbbecbd03f3b0f91df84b23119707d96b7a0d 100644 (file)
@@ -48,12 +48,9 @@ class Mode
   end
 
   def handle_input c
-    if(action = resolve_input c)
-      send action
-      true
-    else
-      false
-    end
+    action = resolve_input(c) or return false
+    send action
+    true
   end
 
   def help_text