| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e621479 commit ef91741
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,11 +25,14 @@ def display_linize(msg, columns, blank_line=False): | |||
| 25 | 25 | """Returns lines obtained by splitting msg over multiple lines. | |
| 26 | 26 | ||
| 27 | 27 | Warning: if msg is empty, returns an empty list of lines""" | |
| 28 | - display_lines = ([msg[start:end] | ||
| 29 | - for start, end in zip( | ||
| 30 | - range(0, len(msg), columns), | ||
| 31 | - range(columns, len(msg) + columns, columns))] | ||
| 32 | - if msg else ([''] if blank_line else [])) | ||
| 28 | + msg = fmtstr(msg) | ||
| 29 | + try: | ||
| 30 | + display_lines = [msg.width_aware_slice(slice(start, end)) | ||
| 31 | + for start, end in zip( | ||
| 32 | + range(0, msg.width, columns), | ||
| 33 | + range(columns, msg.width + columns, columns))] | ||
| 34 | + except ValueError: | ||
| 35 | + display_lines = ([''] if blank_line else []) | ||
| 33 | 36 | return display_lines | |
| 34 | 37 | ||
| 35 | 38 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments