Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of character width for half-width katakana #405

Closed
elfham opened this issue Dec 21, 2021 · 0 comments · Fixed by #406
Closed

Incorrect handling of character width for half-width katakana #405

elfham opened this issue Dec 21, 2021 · 0 comments · Fixed by #406

Comments

@elfham
Copy link
Contributor

elfham commented Dec 21, 2021

Description

There seems to be something wrong with the way the character width of half-width katakana is handled.

Steps to Reproduce

Environment:

irb(main):001:0> irb_info
=>
Ruby version: 2.7.5
IRB version: irb 1.3.8.pre.11 (2021-10-09)
InputMethod: ReidlineInputMethod with Reline 0.2.8.pre.11
RUBY_PLATFORM: amd64-freebsd13
LANG env: ja_JP.UTF-8
East Asian Ambiguous Width: 2

Scenario:

In irb, type "ガギグゲゴ

Expected:

% irb
irb(main):001:0" "ガギグゲゴ
                            _

The cursor is located at the end of line.

Actual:

% irb
irb(main):001:0" "ガギグゲゴ
                       _

The cursor is located in the word.

irb(main):001:0> ga = "ガ"
=> "ガ"
irb(main):002:0> ga.grapheme_clusters
=> ["ガ"]
irb(main):003:0> Reline::Unicode.get_mbchar_width(ga)
=> 1
irb(main):004:0>

Terminal Emulator

PuTTYrv 0.76-ranvis (CJK)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant