smartlog: simplify the coloration code with a list compression

Shorte, easier to read.
This commit is contained in:
Pierre-Yves David 2014-06-10 16:53:53 -07:00
parent ad5b4b4916
commit ab68fa3ea3

View File

@ -43,11 +43,7 @@ def uisetup(ui):
elif char == "x":
color = "\033[30m\033[1m"
if color is not None:
newtext = []
for line in text:
line = color + line + "\033[0m"
newtext.append(line)
text = newtext
text = [color + line + "\033[0m" for line in text]
return orig(ui, state, type, char, text, coldata)
wrapfunction(graphmod, 'ascii', ascii)