Skip to content

Commit

Permalink
Use sort.last instead of sort.reverse.first
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Sep 5, 2021
1 parent 8fca5f6 commit 67f1d8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/reline/key_stroke.rb
Expand Up @@ -84,7 +84,7 @@ def match_status(input)

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]

Expand Down

0 comments on commit 67f1d8d

Please sign in to comment.