##// END OF EJS Templates
color: extract method for determining a valid effect...
Sean Farley -
r20992:05086b56 default
parent child Browse files
Show More
@@ -311,6 +311,15 b' def extstyles():'
311 for name, ext in extensions.extensions():
311 for name, ext in extensions.extensions():
312 _styles.update(getattr(ext, 'colortable', {}))
312 _styles.update(getattr(ext, 'colortable', {}))
313
313
314 def valideffect(effect):
315 'Determine if the effect is valid or not.'
316 good = False
317 if not _terminfo_params and effect in _effects:
318 good = True
319 elif effect in _terminfo_params or effect[:-11] in _terminfo_params:
320 good = True
321 return good
322
314 def configstyles(ui):
323 def configstyles(ui):
315 for status, cfgeffects in ui.configitems('color'):
324 for status, cfgeffects in ui.configitems('color'):
316 if '.' not in status or status.startswith('color.'):
325 if '.' not in status or status.startswith('color.'):
@@ -319,9 +328,7 b' def configstyles(ui):'
319 if cfgeffects:
328 if cfgeffects:
320 good = []
329 good = []
321 for e in cfgeffects:
330 for e in cfgeffects:
322 if not _terminfo_params and e in _effects:
331 if valideffect(e):
323 good.append(e)
324 elif e in _terminfo_params or e[:-11] in _terminfo_params:
325 good.append(e)
332 good.append(e)
326 else:
333 else:
327 ui.warn(_("ignoring unknown color/effect %r "
334 ui.warn(_("ignoring unknown color/effect %r "
General Comments 0
You need to be logged in to leave comments. Login now