lib/textbringer/keymap.rb in textbringer-0.2.7 vs lib/textbringer/keymap.rb in textbringer-0.2.8
- old
+ new
@@ -29,10 +29,15 @@
raise ArgumentError, "Empty key"
when 1
@map[key_sequence.first]
else
k, *ks = key_sequence
- @map[k]&.lookup(ks)
+ km = @map[k]
+ if km.is_a?(Keymap)
+ km.lookup(ks)
+ else
+ nil
+ end
end
end
def each(prefixes = [], &block)
@map.each do |key, val|