Subject: [sup-talk] [PATCH] Small bug fix in keymap run_hook method

From: Ben Walton <[email-masked]>
Date: Tue, 2 Mar 2010 13:58:15 -0500

Splat the array that is returned from Modes.keymaps.map when it is
passed into Hash[] to avoid an error about an odd number of parameters
being passes to the method.

Error was:
./sup/keymap.rb:129:in `[]': odd number of arguments for Hash
(ArgumentError)
        from ./sup/keymap.rb:129:in `run_hook'
        from ../bin/sup:98

Signed-off-by: Ben Walton <[email-masked]>
---

This time with correct spelling in commit message. :)

 lib/sup/keymap.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/keymap.rb b/lib/sup/keymap.rb
index 93060b8..8d54924 100644
--- a/lib/sup/keymap.rb
+++ b/lib/sup/keymap.rb
@@ -126,7 +126,7 @@ EOS
   end
 
   def self.run_hook global_keymap
-    modes = Hash[Mode.keymaps.map { |klass,keymap| [Mode.make_name(klass.name),klass] }]
+    modes = Hash[*Mode.keymaps.map { |klass,keymap| [Mode.make_name(klass.name),klass] }]
     locals = {
       :modes => modes,
       :global_keymap => global_keymap,
-- 
1.7.0

_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Ben Walton <[email-masked]>
Date: Tue, 2 Mar 2010 13:49:06 -0500

I just merged the tip of origin/next and sup blew up on me.  The
attached patch corrects this bug and, I think, provides the intended
behaviour.

Ben Walton (1):
  Small bug ifx in keymap run_hook method

 lib/sup/keymap.rb |    2 +-

---

From: Ben Walton <[email-masked]>
Date: Tue, 2 Mar 2010 13:49:07 -0500

Error was: