Mercurial > hg
comparison hgext/highlight/highlight.py @ 38359:876352ea831e
highlight: adjust to attribute being private
Differential Revision: https://phab.mercurial-scm.org/D3772
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Sun, 17 Jun 2018 23:00:08 -0400 |
parents | 670eb4fa1b86 |
children | 23dc901cdf13 |
comparison
equal
deleted
inserted
replaced
38358:57dc72b56b6c | 38359:876352ea831e |
---|---|
87 | 87 |
88 colorized = highlight(text, lexer, formatter) | 88 colorized = highlight(text, lexer, formatter) |
89 coloriter = (s.encode(encoding.encoding, 'replace') | 89 coloriter = (s.encode(encoding.encoding, 'replace') |
90 for s in colorized.splitlines()) | 90 for s in colorized.splitlines()) |
91 | 91 |
92 tmpl.filters['colorize'] = lambda x: next(coloriter) | 92 tmpl._filters['colorize'] = lambda x: next(coloriter) |
93 | 93 |
94 oldl = tmpl.cache[field] | 94 oldl = tmpl.cache[field] |
95 newl = oldl.replace('line|escape', 'line|colorize') | 95 newl = oldl.replace('line|escape', 'line|colorize') |
96 tmpl.cache[field] = newl | 96 tmpl.cache[field] = newl |