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

Match highlighting doesn't work correctly with Japanese, etc. #22

Open
slevithan opened this issue Apr 7, 2024 · 1 comment
Open

Match highlighting doesn't work correctly with Japanese, etc. #22

slevithan opened this issue Apr 7, 2024 · 1 comment

Comments

@slevithan
Copy link
Contributor

The reason is match/subpattern highlighting expects every character to take the same width due to the use of a monospace font. However, the width of e.g. English characters doesn't apply to e.g. Japanese characters.

Example: try using /./ to match "片仮名" or "カタカナ".

There's probably some way to determine the actual width of matched text as rendered on the screen, which would be a part of fixing this.

@slevithan
Copy link
Contributor Author

The library https://github.com/sindresorhus/string-width offers an alternative approach that might be helpful with this.

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

No branches or pull requests

1 participant