aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline
diff options
context:
space:
mode:
authorima1zumi <52617472+ima1zumi@users.noreply.github.com>2023-06-23 02:07:19 +0900
committergit <svn-admin@ruby-lang.org>2023-06-22 17:07:23 +0000
commit218a8d8ef1504e98e59f65c135dba8d0991dca93 (patch)
treedff6cc7df6d906d4e12de1033c8ee034a54544b6 /lib/reline
parentde51a4a13eab2c4c5917de923edde33dfed6f22f (diff)
downloadruby-218a8d8ef1504e98e59f65c135dba8d0991dca93.tar.gz
[ruby/reline] Remove unused method
(https://github.com/ruby/reline/pull/557) `get_mbchar_byte_size_by_first_char` isn't used in Reline. Also, this method implements the same functionality as `String#bytesize` and is unnecessary.
Diffstat (limited to 'lib/reline')
-rw-r--r--lib/reline/unicode.rb20
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/reline/unicode.rb b/lib/reline/unicode.rb
index 0a7f59cf06..26ef207ba6 100644
--- a/lib/reline/unicode.rb
+++ b/lib/reline/unicode.rb
@@ -41,26 +41,6 @@ class Reline::Unicode
OSC_REGEXP = /\e\]\d+(?:;[^;\a\e]+)*(?:\a|\e\\)/
WIDTH_SCANNER = /\G(?:(#{NON_PRINTING_START})|(#{NON_PRINTING_END})|(#{CSI_REGEXP})|(#{OSC_REGEXP})|(\X))/o
- def self.get_mbchar_byte_size_by_first_char(c)
- # Checks UTF-8 character byte size
- case c.ord
- # 0b0xxxxxxx
- when ->(code) { (code ^ 0b10000000).allbits?(0b10000000) } then 1
- # 0b110xxxxx
- when ->(code) { (code ^ 0b00100000).allbits?(0b11100000) } then 2
- # 0b1110xxxx
- when ->(code) { (code ^ 0b00010000).allbits?(0b11110000) } then 3
- # 0b11110xxx
- when ->(code) { (code ^ 0b00001000).allbits?(0b11111000) } then 4
- # 0b111110xx
- when ->(code) { (code ^ 0b00000100).allbits?(0b11111100) } then 5
- # 0b1111110x
- when ->(code) { (code ^ 0b00000010).allbits?(0b11111110) } then 6
- # successor of mbchar
- else 0
- end
- end
-
def self.escape_for_print(str)
str.chars.map! { |gr|
escaped = EscapedPairs[gr.ord]