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
I would like to avoid trailing whitespace (for pointless aesthetic reasons), hence the .rstrip(). That doesn't work when text_for_part3 is an empty string, because the escape sequences for color changes get inserted anyway.
I would like to suggest that FormattingString.__call__ ought to check if the text parameter is empty and if so avoid wrapping it in formatting/reset codes.
I'm willing to prepare a PR if you think that's a reasonable idea.
The text was updated successfully, but these errors were encountered:
sbraz
pushed a commit
to sbraz/blessed
that referenced
this issue
Apr 26, 2020
I would like to format a line of text with optional trailing parts like this:
I would like to avoid trailing whitespace (for pointless aesthetic reasons), hence the .rstrip(). That doesn't work when text_for_part3 is an empty string, because the escape sequences for color changes get inserted anyway.
I would like to suggest that
FormattingString.__call__
ought to check if the text parameter is empty and if so avoid wrapping it in formatting/reset codes.I'm willing to prepare a PR if you think that's a reasonable idea.
The text was updated successfully, but these errors were encountered: