Skip to content

Conversation

yihong0618
Copy link
Contributor

@yihong0618 yihong0618 commented Sep 23, 2025

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@yihong0618 yihong0618 changed the title fix: zero-width word paste can be wrong in default repl gh-139246: zero-width word paste can be wrong in default repl Sep 23, 2025
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@yihong0618 yihong0618 requested a review from grayjk September 24, 2025 00:14
@yihong0618 yihong0618 marked this pull request as ready for review September 24, 2025 00:14
Co-authored-by: grayjk <grayjk@gmail.com>

@functools.cache
def str_width(c: str) -> int:
if ord(c) < 128:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this issue but quite a few of the characters with ord < 128, do not have a display width of 1

for example, in my terminal, tab (ord 9) is 8 charaters wide

something to consider for a future PR

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

Successfully merging this pull request may close these issues.

2 participants