From ae171ac7da668681e897efceb0de42a74283f5f5 Mon Sep 17 00:00:00 2001 From: Tom Ballinger Date: Tue, 13 Feb 2018 12:10:01 -0800 Subject: [PATCH 1/2] Use width_aware_splitlines from new Curtsies --- bpython/curtsiesfrontend/replpainter.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bpython/curtsiesfrontend/replpainter.py b/bpython/curtsiesfrontend/replpainter.py index 36c9c1324..11dbe8011 100644 --- a/bpython/curtsiesfrontend/replpainter.py +++ b/bpython/curtsiesfrontend/replpainter.py @@ -25,12 +25,10 @@ def display_linize(msg, columns, blank_line=False): """Returns lines obtained by splitting msg over multiple lines. Warning: if msg is empty, returns an empty list of lines""" - display_lines = ([msg[start:end] - for start, end in zip( - range(0, len(msg), columns), - range(columns, len(msg) + columns, columns))] - if msg else ([''] if blank_line else [])) - return display_lines + if not msg: + return [''] if blank_line else [] + msg = fmtstr(msg) + return list(msg.width_aware_splitlines(columns)) def paint_history(rows, columns, display_lines): From 5c2160a2fec97202391bd7827382e2a88bcecc46 Mon Sep 17 00:00:00 2001 From: Tom Ballinger Date: Tue, 13 Feb 2018 12:12:28 -0800 Subject: [PATCH 2/2] bump required Curtsies version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 709668165..7f6bdeb5f 100755 --- a/setup.py +++ b/setup.py @@ -213,7 +213,7 @@ def initialize_options(self): install_requires = [ 'pygments', 'requests', - 'curtsies >=0.1.18', + 'curtsies >=0.3.0', 'greenlet', 'six >=1.5' ]