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 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Ben Walton
2010-Mar-02 18:49 UTC
[sup-talk] [PATCH] Small bug ifx in keymap run_hook method
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 <bwalton at artsci.utoronto.ca>
---
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
Ben Walton
2010-Mar-02 18:58 UTC
[sup-talk] [PATCH] Small bug fix in keymap run_hook method
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 <bwalton at artsci.utoronto.ca>
---
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