(
self,
reversed_chunks: list[str],
cur_line: list[str],
cur_len: int,
width: int,
)
| 46 | class="st">""" |
| 47 | |
| 48 | def _handle_long_word( |
| 49 | self, |
| 50 | reversed_chunks: list[str], |
| 51 | cur_line: list[str], |
| 52 | cur_len: int, |
| 53 | width: int, |
| 54 | ) -> None: |
| 55 | space_left = max(width - cur_len, 1) |
| 56 | |
| 57 | if self.break_long_words: |
| 58 | last = reversed_chunks[-1] |
| 59 | cut = _truncate_visible(last, space_left) |
| 60 | res = last[len(cut) :] |
| 61 | cur_line.append(cut) |
| 62 | reversed_chunks[-1] = res |
| 63 | elif not cur_line: |
| 64 | cur_line.append(reversed_chunks.pop()) |
| 65 | |
| 66 | def _wrap_chunks(self, chunks: list[str]) -> list[str]: |
| 67 | class="st">"""Wrap chunks counting widths in visible characters. |
no test coverage detected