Skip to content

Commit

Permalink
Merge pull request #1 from vlazar/patch-1
Browse files Browse the repository at this point in the history
Remove the use of deprecated String#codepoint_at
  • Loading branch information
docelic committed Mar 11, 2020
2 parents 5c09c11 + c625599 commit 37d4964
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/keys.cr
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ module TermApp
elsif s.size == 1 && s <= "\x1a"
# ctrl+letter
# TODO can't String.new from codepoint
name = (s.codepoint_at(0) + "a".codepoint_at(0) - 1).to_s # or .chr.to_s
name = (s.char_at(0).ord + "a".char_at(0).ord - 1).to_s # or .chr.to_s
ctrl = true

elsif s.size == 1 && s >= "a" && s <= "z"
Expand Down

0 comments on commit 37d4964

Please sign in to comment.