(s: str)
| 76 | |
| 77 | |
| 78 | def wlen(s: str) -> int: |
| 79 | if len(s) == 1 and s != "\x1a": |
| 80 | return str_width(s) |
| 81 | length = sum(str_width(i) for i in s) |
| 82 | # remove lengths of any escape sequences |
| 83 | sequence = ANSI_ESCAPE_SEQUENCE.findall(s) |
| 84 | ctrl_z_cnt = s.count("\x1a") |
| 85 | return length - sum(len(i) for i in sequence) + ctrl_z_cnt |
| 86 | |
| 87 | |
| 88 | def unbracket(s: str, including_content: bool = False) -> str: |
searching dependent graphs…