diff options
author | aycabta <aycabta@gmail.com> | 2019-12-02 03:30:38 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-12-02 03:30:38 +0900 |
commit | c7f05310a248e44ef9747a159a0e9bc289bb7090 (patch) | |
tree | 1616f153ace36481c97b8e320da6b6db7e7b651a /lib/reline/line_editor.rb | |
parent | e15b0313a78a6f381720cf362a1a94bda49f62ff (diff) | |
download | ruby-c7f05310a248e44ef9747a159a0e9bc289bb7090.tar.gz |
Process Backspace key in incremental search correctly
Diffstat (limited to 'lib/reline/line_editor.rb')
-rw-r--r-- | lib/reline/line_editor.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 1286adb7a3..950bc3a955 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1159,7 +1159,7 @@ class Reline::LineEditor loop do key = Fiber.yield(search_word) case key - when "\C-h".ord, 127 + when "\C-h".ord, "\C-?".ord grapheme_clusters = search_word.grapheme_clusters if grapheme_clusters.size > 0 grapheme_clusters.pop @@ -1217,7 +1217,7 @@ class Reline::LineEditor @searching_prompt = "(reverse-i-search)`': " @waiting_proc = ->(k) { case k - when "\C-j".ord, "\C-?".ord + when "\C-j".ord if @history_pointer @line = Reline::HISTORY[@history_pointer] else @@ -1237,7 +1237,7 @@ class Reline::LineEditor @cursor = @byte_pointer = 0 else chr = k.is_a?(String) ? k : k.chr(Encoding::ASCII_8BIT) - if chr.match?(/[[:print:]]/) or k == "\C-h".ord or k == 127 + if chr.match?(/[[:print:]]/) or k == "\C-h".ord or k == "\C-?".ord searcher.resume(k) else if @history_pointer |