ruby-changes:59030
From: aycabta <ko1@a...>
Date: Mon, 2 Dec 2019 03:32:02 +0900 (JST)
Subject: [ruby-changes:59030] c7f05310a2 (master): Process Backspace key in incremental search correctly
https://git.ruby-lang.org/ruby.git/commit/?id=c7f05310a2 From c7f05310a248e44ef9747a159a0e9bc289bb7090 Mon Sep 17 00:00:00 2001 From: aycabta <aycabta@g...> Date: Mon, 2 Dec 2019 03:30:38 +0900 Subject: Process Backspace key in incremental search correctly diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 1286adb..950bc3a 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1159,7 +1159,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L1159 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 https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L1217 @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 https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L1237 @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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/