Skip to content

Commit

Permalink
Ignore unknown commands in config file, fixes ConnorAtherton#106
Browse files Browse the repository at this point in the history
  • Loading branch information
camdez committed Oct 17, 2014
1 parent ce4908d commit 644fb9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rbreadline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,8 @@ def rl_named_function(name)
return :rl_beg_of_line
else
if name =~ /^[-a-z]+$/
return ('rl_'+name.gsub('-','_')).to_sym
method = ('rl_' + name.gsub('-', '_')).to_sym
return method if respond_to?(method)
end
end
nil
Expand Down Expand Up @@ -2416,7 +2417,8 @@ def rl_parse_and_bind(string)

if string =~ /"(.*)"\s*:\s*(.*)$/
key, funname = $1, $2
rl_bind_key(key, rl_named_function(funname))
func = rl_named_function(funname)
rl_bind_key(key, func) if func
end

0
Expand Down

0 comments on commit 644fb9e

Please sign in to comment.