From d8c6b5eecbf0c2793644e0a7e2e65055da23be43 Mon Sep 17 00:00:00 2001 From: elfham <38372058+elfham@users.noreply.github.com> Date: Thu, 24 Aug 2023 21:57:55 +0900 Subject: [PATCH 1/3] Set EastAsianWidth::UNICODE_VERSION --- bin/generate_east_asian_width | 8 ++++++++ lib/reline/unicode/east_asian_width.rb | 1 + 2 files changed, 9 insertions(+) diff --git a/bin/generate_east_asian_width b/bin/generate_east_asian_width index 1172f422a5..d15ebe8783 100755 --- a/bin/generate_east_asian_width +++ b/bin/generate_east_asian_width @@ -6,6 +6,13 @@ if ARGV.empty? end open(ARGV.first, 'rt') do |f| + if m = f.gets.match(/^# EastAsianWidth-(\d+\.\d+\.\d+)\.txt/) + unicode_version = m[1] + else + warn 'Failed to get UNICODE_VERSION' + unicode_version = nil + end + list = [] f.each_line do |line| next unless m = line.match(/^(\h+)(?:\.\.(\h+))?\s*;\s*(\w+)\s+#.+/) @@ -44,6 +51,7 @@ open(ARGV.first, 'rt') do |f| class Reline::Unicode::EastAsianWidth # This is based on EastAsianWidth.txt # #{ARGV.first} + UNICODE_VERSION = #{unicode_version ? "'#{unicode_version}'" : 'nil'} EOH puts grouped.map { |item| diff --git a/lib/reline/unicode/east_asian_width.rb b/lib/reline/unicode/east_asian_width.rb index 97dfec4c52..d8e76f53e2 100644 --- a/lib/reline/unicode/east_asian_width.rb +++ b/lib/reline/unicode/east_asian_width.rb @@ -1,6 +1,7 @@ class Reline::Unicode::EastAsianWidth # This is based on EastAsianWidth.txt # EastAsianWidth.txt + UNICODE_VERSION = '15.0.0' # Fullwidth TYPE_F = /^[#{ %W( From 3344624fef5b818395c3eee6b46d317358fb0d21 Mon Sep 17 00:00:00 2001 From: elfham <38372058+elfham@users.noreply.github.com> Date: Wed, 30 Aug 2023 01:07:44 +0900 Subject: [PATCH 2/3] Commented out UNICODE_VERSION in Reline::Unicode::EastAsianWidth --- bin/generate_east_asian_width | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/generate_east_asian_width b/bin/generate_east_asian_width index d15ebe8783..32e0085f22 100755 --- a/bin/generate_east_asian_width +++ b/bin/generate_east_asian_width @@ -51,7 +51,7 @@ open(ARGV.first, 'rt') do |f| class Reline::Unicode::EastAsianWidth # This is based on EastAsianWidth.txt # #{ARGV.first} - UNICODE_VERSION = #{unicode_version ? "'#{unicode_version}'" : 'nil'} + # UNICODE_VERSION = #{unicode_version ? "'#{unicode_version}'" : 'nil'} EOH puts grouped.map { |item| From 9fda0ab71d878dcea34a384f13b91e28a8fa2373 Mon Sep 17 00:00:00 2001 From: elfham <38372058+elfham@users.noreply.github.com> Date: Wed, 30 Aug 2023 01:09:05 +0900 Subject: [PATCH 3/3] Commented out UNICODE_VERSION in Reline::Unicode::EastAsianWidth --- lib/reline/unicode/east_asian_width.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reline/unicode/east_asian_width.rb b/lib/reline/unicode/east_asian_width.rb index d8e76f53e2..ce7f7f2645 100644 --- a/lib/reline/unicode/east_asian_width.rb +++ b/lib/reline/unicode/east_asian_width.rb @@ -1,7 +1,7 @@ class Reline::Unicode::EastAsianWidth # This is based on EastAsianWidth.txt # EastAsianWidth.txt - UNICODE_VERSION = '15.0.0' + # UNICODE_VERSION = '15.0.0' # Fullwidth TYPE_F = /^[#{ %W(