diff options
author | Ana María Martínez Gómez <anamaria@martinezgomez.name> | 2019-04-07 08:09:07 +0200 |
---|---|---|
committer | Ana María Martínez Gómez <anamaria@martinezgomez.name> | 2019-04-08 16:28:51 +0200 |
commit | 1c9a9a3a9f19b9a97d3650f206acb0e9800611b7 (patch) | |
tree | e6cf1895b4ecba8db0b480108694607da06eab07 /lib | |
parent | 154754be7399229351c2135a3051a0bc11ece4fb (diff) | |
download | highline-1c9a9a3a9f19b9a97d3650f206acb0e9800611b7.tar.gz |
Move downcase of capital letter
Downcase answer after having compared it with the text options to avoid
breaking this case.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/highline/menu.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/highline/menu.rb b/lib/highline/menu.rb index 42be9bd..2ae1ad3 100755 --- a/lib/highline/menu.rb +++ b/lib/highline/menu.rb @@ -408,7 +408,7 @@ class HighLine items = all_items # Find the selected action. - selected_item = find_item_from_selection(items, selection.downcase) + selected_item = find_item_from_selection(items, selection) # Run or return it. @highline = highline_context @@ -437,7 +437,7 @@ class HighLine # 97 is the "a" letter at ascii table # Ex: For "a" it will return 0, and for "c" it will return 2 - index = selection.ord - 97 + index = selection.downcase.ord - 97 items[index] end |