Fix a bug in multiline colored text
if the first, attribute color was negative, the color wasn’t passed on to the next line.
This commit is contained in:
parent
05fa56aea5
commit
275a67864d
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ Standalone functions used by the modules
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import string
|
import string
|
||||||
|
DIGITS = string.digits + '-'
|
||||||
|
|
||||||
from poezio.windows.base_wins import FORMAT_CHAR, format_chars
|
from poezio.windows.base_wins import FORMAT_CHAR, format_chars
|
||||||
|
|
||||||
|
@ -42,7 +43,7 @@ def parse_attrs(text, previous=None):
|
||||||
attrs.append('u')
|
attrs.append('u')
|
||||||
elif attr_char == 'b':
|
elif attr_char == 'b':
|
||||||
attrs.append('b')
|
attrs.append('b')
|
||||||
if attr_char in string.digits and attr_char:
|
if attr_char in DIGITS and attr_char:
|
||||||
color_str = text[next_attr_char+1:text.find('}', next_attr_char)]
|
color_str = text[next_attr_char+1:text.find('}', next_attr_char)]
|
||||||
if color_str:
|
if color_str:
|
||||||
attrs.append(color_str + '}')
|
attrs.append(color_str + '}')
|
||||||
|
|
Loading…
Reference in a new issue