You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Unicode codepoints U 2028 (Line Separator) and U 2029 (Paragraph Separator) are kind of treated as line breaks by Text.pack() but as normal zero-width symbols by Text.render(), instead of omitting the codepoints, breaking the text and padding the line as necessary.
I said "kind of" because pack() returns the width as though the text is broken by the codepoint(s) but the height is always 1, regardless of how many of these codepoints there are in the text.
By the way, urwid.calc_width() treats them as zero-width symbols.
I honestly care less whether they're treated as actual line breaks or just plain zero-width symbols and escaped (replaced with "?") like other whitespace codepoints such as U 0009 (Horizontal Tab, \t), all I care about is that they're handled consistently.
Thank you 😃
The text was updated successfully, but these errors were encountered:
- Fix: Use `urwid.calc_width()` instead of `urwid.Text.pack()[0]` to
compute the screen column width of text.
- Additionally results in a performance improvement.
Avoids buggy behaviour of `Text.pack()`
(see urwid/urwid#924) and
fixesihabunek/toot#499.
- Fix: Use `urwid.calc_width()` instead of `urwid.Text.pack()[0]` to
compute the screen column width of text.
- Additionally results in a performance improvement.
Avoids buggy behaviour of `Text.pack()`
(see urwid/urwid#924) and
fixesihabunek/toot#499.
Description:
The Unicode codepoints U 2028 (Line Separator) and U 2029 (Paragraph Separator) are kind of treated as line breaks by
Text.pack()
but as normal zero-width symbols byText.render()
, instead of omitting the codepoints, breaking the text and padding the line as necessary.I said "kind of" because
pack()
returns the width as though the text is broken by the codepoint(s) but the height is always1
, regardless of how many of these codepoints there are in the text.By the way,
urwid.calc_width()
treats them as zero-width symbols.Affected versions (if applicable)
master
branch (specify commit)pypi
Steps to reproduce (if applicable)
Text.pack()
:Text.render()
:Expected/actual outcome
I honestly care less whether they're treated as actual line breaks or just plain zero-width symbols and escaped (replaced with "?") like other whitespace codepoints such as U 0009 (Horizontal Tab,
\t
), all I care about is that they're handled consistently.Thank you 😃
The text was updated successfully, but these errors were encountered: