Show More
@@ -331,16 +331,17 class colorui(uimod.ui): | |||
|
331 | 331 | def label(self, msg, label): |
|
332 | 332 | if self._colormode is None: |
|
333 | 333 | return super(colorui, self).label(msg, label) |
|
334 | return colorlabel(self, msg, label) | |
|
334 | 335 | |
|
335 | if self._colormode == 'debug': | |
|
336 | def colorlabel(ui, msg, label): | |
|
337 | """add color control code according to the mode""" | |
|
338 | if ui._colormode == 'debug': | |
|
336 | 339 |
|
|
337 | 340 |
|
|
338 |
|
|
|
341 | msg = "[%s|%s]\n" % (label, msg[:-1]) | |
|
339 | 342 |
|
|
340 |
|
|
|
341 | else: | |
|
342 | return msg | |
|
343 | ||
|
343 | msg = "[%s|%s]" % (label, msg) | |
|
344 | elif ui._colormode is not None: | |
|
344 | 345 | effects = [] |
|
345 | 346 | for l in label.split(): |
|
346 | 347 | s = color._styles.get(l, '') |
@@ -350,7 +351,7 class colorui(uimod.ui): | |||
|
350 | 351 | effects.append(l) |
|
351 | 352 | effects = ' '.join(effects) |
|
352 | 353 | if effects: |
|
353 |
|
|
|
354 | msg = '\n'.join([color._render_effects(line, effects) | |
|
354 | 355 |
|
|
355 | 356 |
|
|
356 | 357 |
General Comments 0
You need to be logged in to leave comments.
Login now