gh-139246: zero-width word paste can be wrong in default repl#139254
gh-139246: zero-width word paste can be wrong in default repl#139254encukou merged 4 commits intopython:mainfrom
Conversation
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: grayjk <grayjk@gmail.com>
| @@ -63,6 +63,14 @@ class ColorSpan(NamedTuple): | |||
| def str_width(c: str) -> int: | |||
| if ord(c) < 128: | |||
There was a problem hiding this comment.
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) | ||
| if category == "Cf" and c != "\u00ad": | ||
| return 0 | ||
| if "\u2028" <= c <= "\u2029": |
There was a problem hiding this comment.
Hmm, what terminal are you using? Here (on VTE) these take up one cell.
There was a problem hiding this comment.
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.
of course will do it
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
|
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 commit 4e6dba0) 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 the 3.14 branch. |
… repl (pythonGH-139254) (cherry picked from commit 4e6dba0) 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 the 3.13 branch. |
…ythonGH-139254) Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: grayjk <grayjk@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.