Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.4k
gh-139246: zero-width word paste can be wrong in default repl#139254
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: grayjk <grayjk@gmail.com>
| @functools.cache | ||
| defstr_width(c:str)->int: | ||
| iford(c)<128: |
There was a problem hiding this comment.
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
Lib/_pyrepl/utils.py Outdated
| category=unicodedata.category(c) | ||
| ifcategory=="Cf"andc!="\u00ad": | ||
| return0 | ||
| if"\u2028"<=c<="\u2029": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hmm, what terminal are you using? Here (on VTE) these take up one cell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
mac with kitty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
if \u2028 and \u2029 aren't consistent across terminals, could remove this condition since it is unrelated to the original issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
of course will do it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
fixed
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
4e6dba0 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@yihong0618 for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Thanks@yihong0618 for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry,@yihong0618 and@encukou, I could not cleanly backport this to |
…ythonGH-139254)(cherry picked from commit4e6dba0)Co-authored-by: yihong <zouzou0208@gmail.com>Signed-off-by: yihong0618 <zouzou0208@gmail.com>Co-authored-by: grayjk <grayjk@gmail.com>
GH-140796 is a backport of this pull request to the3.14 branch. |
… repl (pythonGH-139254)(cherry picked from commit4e6dba0)Co-authored-by: yihong <zouzou0208@gmail.com>Signed-off-by: yihong0618 <zouzou0208@gmail.com>Co-authored-by: grayjk <grayjk@gmail.com>
GH-141166 is a backport of this pull request to the3.13 branch. |
Uh oh!
There was an error while loading.Please reload this page.