Patchwork D1619: highlight: eagerly discover plugin lexers while demandimport is off

login
register
mail settings
Submitter phabricator
Date Dec. 9, 2017, 1:52 a.m.
Message ID <a701264e23ccc9dde498e06b788be85c@localhost.localdomain>
Download mbox | patch
Permalink /patch/26133/
State Not Applicable
Headers show

Comments

phabricator - Dec. 9, 2017, 1:52 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG169d66db5920: highlight: eagerly discover plugin lexers while demandimport is off (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1619?vs=4274&id=4280

REVISION DETAIL
  https://phab.mercurial-scm.org/D1619

AFFECTED FILES
  hgext/highlight/highlight.py

CHANGE DETAILS




To: durin42, #hg-reviewers, quark, yuja
Cc: mercurial-devel

Patch

diff --git a/hgext/highlight/highlight.py b/hgext/highlight/highlight.py
--- a/hgext/highlight/highlight.py
+++ b/hgext/highlight/highlight.py
@@ -22,8 +22,12 @@ 
     import pygments
     import pygments.formatters
     import pygments.lexers
+    import pygments.plugin
     import pygments.util
 
+    for unused in pygments.plugin.find_plugin_lexers():
+        pass
+
 highlight = pygments.highlight
 ClassNotFound = pygments.util.ClassNotFound
 guess_lexer = pygments.lexers.guess_lexer