output of len() needs to have a -1 on it when matching it against indexes

within the given string (src/utils/irc.py)
This commit is contained in:
jesopo 2019-01-16 12:42:45 +00:00
parent 2331205368
commit 4c5af0845c

View file

@ -161,7 +161,7 @@ def _format_tokens(s: str) -> typing.List[str]:
matches = [] # type: typing.List[str]
for i, char in enumerate(s):
last_char = i == len(s)
last_char = i == len(s)-1
if is_color:
can_add = False
current_color = background if is_background else foreground