diff options
author | aycabta <aycabta@gmail.com> | 2021-09-07 03:19:50 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-09-07 03:23:33 +0900 |
commit | b4d9126e4332619644bfc9284688c1a8bd56d8ad (patch) | |
tree | 65b3286534918960fd50080bc078a0f7c1616068 | |
parent | 2441bc8ea90b4e6790afb3174167103ec6a3b240 (diff) |
[ruby/reline] Refactor the merging key bindings to make it more readable
https://github.com/ruby/reline/commit/59665a22de
-rw-r--r-- | lib/reline/config.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/reline/config.rb b/lib/reline/config.rb index a46be280a0..4b2655d8eb 100644 --- a/lib/reline/config.rb +++ b/lib/reline/config.rb @@ -155,7 +155,10 @@ class Reline::Config def key_bindings # The key bindings for each editing mode will be overwritten by the user-defined ones. - @key_actors[@editing_mode_label].default_key_bindings.merge(@additional_key_bindings[@editing_mode_label]).merge(@oneshot_key_bindings) + kb = @key_actors[@editing_mode_label].default_key_bindings.dup + kb.merge!(@additional_key_bindings[@editing_mode_label]) + kb.merge!(@oneshot_key_bindings) + kb end def add_oneshot_key_binding(keystroke, target) |