| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Trac
Revision: 7485
Author: thatch
Date: 20 Aug 2008 22:49:33
Diff at Trac: http://trac.edgewall.org/changeset/7485
Changes:Allow Pygments lexers with no aliases to work correctly, by defaulting to
the name.
| ... | ...@@ -177,9 +177,10 @@ | |
| 177 | 177 | |
| 178 | 178 | def _init_types(self): |
| 179 | 179 | self._types = {} |
| 180 | for _, aliases, _, mimetypes in get_all_lexers(): | |
| 180 | for lexname, aliases, _, mimetypes in get_all_lexers(): | |
| 181 | name = aliases and aliases[0] or lexname | |
| 181 | 182 | for mimetype in mimetypes: |
| 182 | self._types[mimetype] = (aliases[0], self.QUALITY_RATIO) | |
| 183 | self._types[mimetype] = (name, self.QUALITY_RATIO) | |
| 183 | 184 | self._types.update( |
| 184 | 185 | Mimeview(self.env).configured_modes_mapping('pygments') |
| 185 | 186 | ) |