natty-ui 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/natty-ui/text/east_asian_width.rb +2518 -1264
- data/lib/natty-ui/text.rb +3 -3
- data/lib/natty-ui/version.rb +1 -1
- metadata +3 -3
data/lib/natty-ui/text.rb
CHANGED
@@ -42,8 +42,8 @@ module NattyUI
|
|
42
42
|
# works for UTF-8 chars only!
|
43
43
|
def char_width(char)
|
44
44
|
ord = char.ord
|
45
|
-
return
|
46
|
-
return 1 if ord
|
45
|
+
return WIDTH_CONTROL_CHARS[ord] || 2 if ord < 0x20
|
46
|
+
return 1 if ord < 0xa1
|
47
47
|
size = EastAsianWidth[ord]
|
48
48
|
return @ambiguous_char_width if size == -1
|
49
49
|
if size == 1 && char.size >= 2
|
@@ -158,7 +158,7 @@ module NattyUI
|
|
158
158
|
UTF_8 = Encoding::UTF_8
|
159
159
|
BBCODE = /(?:\[((?~[\[\]]))\])/
|
160
160
|
WIDTH_SCANNER = /\G(?:(\1)|(\2)|(#{Ansi::CSI})|(#{Ansi::OSC})|(\X))/
|
161
|
-
|
161
|
+
WIDTH_CONTROL_CHARS = {
|
162
162
|
0x00 => 0,
|
163
163
|
0x01 => 1,
|
164
164
|
0x02 => 1,
|
data/lib/natty-ui/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: natty-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Blumtritt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
This is the beautiful, nice, nifty, fancy, neat, pretty, cool, lovely,
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
rubygems_version: 3.5.
|
99
|
+
rubygems_version: 3.5.17
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: This is the beautiful, nice, nifty, fancy, neat, pretty, cool, lovely, natty
|