From 8913b9b742b425b7660870a20adcebb400453221 Mon Sep 17 00:00:00 2001 From: aycabta Date: Mon, 6 Sep 2021 04:05:07 +0900 Subject: [PATCH] [ruby/reline] Use sort.last instead of sort.reverse.first https://github.com/ruby/reline/commit/67f1d8d2d2 --- lib/reline/key_stroke.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reline/key_stroke.rb b/lib/reline/key_stroke.rb index 675b658f57..e097924aec 100644 --- a/lib/reline/key_stroke.rb +++ b/lib/reline/key_stroke.rb @@ -84,7 +84,7 @@ class Reline::KeyStroke def expand(input) input = input.compress_meta_key - lhs = key_mapping.keys.select { |item| input.start_with? item }.sort_by(&:size).reverse.first + lhs = key_mapping.keys.select { |item| input.start_with? item }.sort_by(&:size).last return input unless lhs rhs = key_mapping[lhs]