Commit e033d799 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Fix crash in console output when colors are disabled

Without any colors, TopydoString doesn't have any colors set resulting
in an empty markup item. That made the urwid library trip.
parent 7ea66ee2
......@@ -34,6 +34,12 @@ def topydostringToMarkup(p_string):
markup = []
color_positions = sorted(p_string.colors.items())
# in case no color positions are available, at least set something at the
# start position
if not color_positions:
color_positions = [(0, None)]
for i, (start_pos, color) in enumerate(color_positions):
# color starts at indicated position
start = start_pos
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment