GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-139246: zero-width word paste can be wrong in default repl by yihong0618 · Pull Request #139254 · python/cpython Conversation
| |||||||||||||||||||||||||||
| @@ -63,6 +63,14 @@ class ColorSpan(NamedTuple): | |||
| def str_width(c: str) -> int: | |||
| if ord(c) < 128: | |||
There was a problem 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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| category = unicodedata.category(c) | ||
| if category == "Cf" and c != "\u00ad": | ||
| return 0 | ||
| if "\u2028" <= c <= "\u2029": |
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
mac with kitty
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
of course will do it
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Signed-off-by: yihong0618 <[email protected]>
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. |
Sorry, something went wrong.
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.14. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @yihong0618 and @encukou, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ythonGH-139254) (cherry picked from commit 4e6dba0) Co-authored-by: yihong <[email protected]> Signed-off-by: yihong0618 <[email protected]> Co-authored-by: grayjk <[email protected]>
|
GH-140796 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… repl (pythonGH-139254) (cherry picked from commit 4e6dba0) Co-authored-by: yihong <[email protected]> Signed-off-by: yihong0618 <[email protected]> Co-authored-by: grayjk <[email protected]>
|
GH-141166 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…H-139254) (GH-140796) gh-139246: zero-width word paste can be wrong in default repl (GH-139254) (cherry picked from commit 4e6dba0) Signed-off-by: yihong0618 <[email protected]> Co-authored-by: yihong <[email protected]> Co-authored-by: grayjk <[email protected]>
…H-139254) (GH-141166) (cherry picked from commit 4e6dba0) Signed-off-by: yihong0618 <[email protected]> Co-authored-by: yihong <[email protected]> Co-authored-by: grayjk <[email protected]>
…ythonGH-139254) Signed-off-by: yihong0618 <[email protected]> Co-authored-by: grayjk <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.