hgext/color.py
changeset 10831 441f5d66da03
parent 10827 b66388f6adfa
child 10869 2d57be56c500
equal deleted inserted replaced
10830:824310023e4a 10831:441f5d66da03
   132                             % (e, status))
   132                             % (e, status))
   133             _styles[status] = ' '.join(good)
   133             _styles[status] = ' '.join(good)
   134 
   134 
   135 _buffers = None
   135 _buffers = None
   136 def style(msg, label):
   136 def style(msg, label):
   137     effects = ''
   137     effects = []
   138     for l in label.split():
   138     for l in label.split():
   139         effects += _styles.get(l, '')
   139         s = _styles.get(l, '')
       
   140         if s:
       
   141             effects.append(s)
       
   142     effects = ''.join(effects)
   140     if effects:
   143     if effects:
   141         return '\n'.join([render_effects(s, effects)
   144         return '\n'.join([render_effects(s, effects)
   142                           for s in msg.split('\n')])
   145                           for s in msg.split('\n')])
   143     return msg
   146     return msg
   144 
   147