summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAna María Martínez Gómez <anamaria@martinezgomez.name>2019-04-07 08:09:07 +0200
committerAna María Martínez Gómez <anamaria@martinezgomez.name>2019-04-08 16:28:51 +0200
commit1c9a9a3a9f19b9a97d3650f206acb0e9800611b7 (patch)
treee6cf1895b4ecba8db0b480108694607da06eab07 /lib
parent154754be7399229351c2135a3051a0bc11ece4fb (diff)
downloadhighline-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-xlib/highline/menu.rb4
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