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
def_format_content(self, content='', align='left'):
# remove color str which is invisible and get the actual len of content(wide char counts for 2)len_visible_chars=sum(get_width(ord(ch)) forchinstrip_color(content))
len_invisible_chars=len(content) -len_visible_charsreturn'{lp}{text:{al}{width}}{rp}'.format(lp=' '*self.padding.left,
rp=' '*self.padding.right,
text=content, al=self._alignment_char(align),
width=(self.calculate_border_width() -self.padding.left-self.padding.right-2+len_invisible_chars))
The text was updated successfully, but these errors were encountered:
fromansiwrapimportstrip_colorfromurwidimportcalc_widthdefgetVisibleLength(text: str):
text=strip_color(text)
returncalc_width(text, 0, len(text))
def_format_content(self, content='', align='left'):
# remove color str which is invisible and get the actual len of content(wide char counts for 2)len_visible_chars=getVisibleLength(content)
len_invisible_chars=len(content) -len_visible_charsreturn'{lp}{text:{al}{width}}{rp}'.format(lp=' '*self.padding.left,
rp=' '*self.padding.right,
text=content, al=self._alignment_char(align),
width=(self.calculate_border_width() -self.padding.left-self.padding.right-2+len_invisible_chars))
Modify MenuComponent class:
The text was updated successfully, but these errors were encountered: