diff options
| author | 2020-06-27 21:50:05 -0400 | |
|---|---|---|
| committer | 2020-06-27 22:53:10 -0400 | |
| commit | e1def9b0704674b94fbceb9f180f535a53952630 (patch) | |
| tree | de1272bc037b662a9cabeffa5ac1cb8e6db11668 | |
| parent | Add block comments to LinePaginator.add_line() (diff) | |
In LinePaginator, use ellipses to show line continuation
| -rw-r--r-- | bot/pagination.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/pagination.py b/bot/pagination.py index 441a63a7b..34ce7317b 100644 --- a/bot/pagination.py +++ b/bot/pagination.py @@ -139,6 +139,10 @@ class LinePaginator(Paginator): remaining_words: the words in `line` which exceed `max_chars`. This value is None if no words could be split from `line`. + If there are any remaining_words, an ellipses is appended to reduced_words and a + continuation header is inserted before remaining_words to visually communicate the line + continuation. + Return a tuple in the format (reduced_words, remaining_words). """ reduced_words = [] @@ -164,7 +168,7 @@ class LinePaginator(Paginator): remaining_words.append(word) return ( - " ".join(reduced_words), + " ".join(reduced_words) + "..." if remaining_words else "", continuation_header + " ".join(remaining_words) if remaining_words else None ) |