-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix double-width characters disappearing when wrapping (#3180)
* Update docstring for `Text.wrap`s width parameter to indicate that it's referring to the number of *single-width* characters. Also a small addition to the gitignore file. * Working on double width wrapping fixes * Chop cells to fit to width * Fix folding when theres already text on line * Update wrapping logic to fix issues with CJK charcters disappearing when the "fold" location sat *within* a double-width character. Ensure we retain browser logic of: if there is no space on the current line, move to a new line, and if theres not enough space on the entire new line, fold the text over multiple lines at appropriate locations. * Remove old TODO comments * Add regression test note * Rename function to avoid breaking change * Update CHANGELOG * Remove old comment that is no longer relevant * Cover off some wrapping edge cases * Adding docstrings to tests explaining their purpose * Renaming a local, function scope function alias * Update rich/_wrap.py Co-authored-by: Rodrigo Girão Serrão <[email protected]> * PR feedback * Testing wrapping with trailing and leading whitespace * Improve docstring wording --------- Co-authored-by: Rodrigo Girão Serrão <[email protected]>
- Loading branch information
1 parent
b32e42b
commit 59b1aca
Showing
6 changed files
with
177 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,3 +117,5 @@ venv.bak/ | |
# airspeed velocity | ||
benchmarks/env/ | ||
benchmarks/html/ | ||
|
||
sandbox/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters