mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-25 09:35:16 +00:00
Made wrap_string carry format strings over to the next line
This commit is contained in:
parent
33e5cad75a
commit
d9a2597617
@ -203,6 +203,16 @@ def wrap_string(string,width,min_lines=0,strip_colors=True):
|
|||||||
for i in range(len(ret),min_lines):
|
for i in range(len(ret),min_lines):
|
||||||
ret.append(" ")
|
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
|
return ret
|
||||||
|
|
||||||
from unicodedata import east_asian_width
|
from unicodedata import east_asian_width
|
||||||
|
Loading…
x
Reference in New Issue
Block a user