diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-01 00:34:38 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-01 00:41:17 +0900 |
commit | 552c42f51f75eeeaa5a46e2df28fd5dab77261da (patch) | |
tree | af77c385949813832e8b8d89ee8cf422c04ddbd8 /lib/reline.rb | |
parent | 8fc552adee76ec324a219ba6b19fa2e39a1e014e (diff) | |
download | ruby-552c42f51f75eeeaa5a46e2df28fd5dab77261da.tar.gz |
Seprate raw keystroke config for each platforms
Diffstat (limited to 'lib/reline.rb')
-rw-r--r-- | lib/reline.rb | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/lib/reline.rb b/lib/reline.rb index 2f5a155636..46856d1a51 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -326,31 +326,7 @@ module Reline @@line_editor.pre_input_hook = @@pre_input_hook @@line_editor.rerender - if IS_WINDOWS - config = { - key_mapping: { - [224, 72] => :ed_prev_history, # ↑ - [224, 80] => :ed_next_history, # ↓ - [224, 77] => :ed_next_char, # → - [224, 75] => :ed_prev_char, # ← - [224, 83] => :key_delete, # Del - [224, 71] => :ed_move_to_beg, # Home - [224, 79] => :ed_move_to_end # End - } - } - else - config = { - key_mapping: { - [27, 91, 65] => :ed_prev_history, # ↑ - [27, 91, 66] => :ed_next_history, # ↓ - [27, 91, 67] => :ed_next_char, # → - [27, 91, 68] => :ed_prev_char, # ← - [27, 91, 51, 126] => :key_delete, # Del - [27, 91, 49, 126] => :ed_move_to_beg,# Home - [27, 91, 52, 126] => :ed_move_to_end # End - } - } - end + config = Reline::IOGate::RAW_KEYSTROKE_CONFIG key_stroke = Reline::KeyStroke.new(config) begin |