diff --git a/deluge/ui/console/modes/format_utils.py b/deluge/ui/console/modes/format_utils.py index 58f3c495e..bf218c9ec 100644 --- a/deluge/ui/console/modes/format_utils.py +++ b/deluge/ui/console/modes/format_utils.py @@ -203,6 +203,16 @@ def wrap_string(string,width,min_lines=0,strip_colors=True): for i in range(len(ret),min_lines): ret.append(" ") + #Carry colors over to the next line + last_color_string = "" + for i, line in enumerate(ret): + if i != 0: + ret[i] = "%s%s" % (last_color_string, ret[i]) + + colors = re.findall("\\{![^!]+!\\}", line) + if colors: + last_color_string = colors[-1] + return ret from unicodedata import east_asian_width