From c6255994faaa8c1a47bd716e38d1702ac17ad366 Mon Sep 17 00:00:00 2001 From: Vladislav Zarakovsky Date: Wed, 11 Mar 2020 09:25:36 +0300 Subject: [PATCH] Remove the use of deprecated String#codepoint_at `String#codepoint_at` is deprecated in Crystal https://github.com/crystal-lang/crystal/pull/8475 and to be removed in this PR https://github.com/crystal-lang/crystal/pull/8476 --- src/keys.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/keys.cr b/src/keys.cr index 16ca24a..f79699f 100644 --- a/src/keys.cr +++ b/src/keys.cr @@ -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"