Skip to content

Commit 1c1499c

Browse files
committed
Ensure re-registering plugins after reloading
This commit uses star-import to re-register internal plugins after reloading LaTeXTools.plugin. Imports are moved to modules, which consume those plugins to avoid cluttering global namespace of LaTeXTools.plugin Python must evaluate the plugin classes for them to be registered.
1 parent 92ec1ab commit 1c1499c

File tree

5 files changed

+3
-5
lines changed

5 files changed

+3
-5
lines changed

latextools/jumpto_pdf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sublime
66
import sublime_plugin
77

8+
from ..plugins.viewer import * # register internal viewer plugins
89
from .latextools_plugin import get_plugin
910
from .latextools_plugin import NoSuchPluginException
1011
from .utils.is_tex_file import is_tex_file

latextools/latex_cite_completions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import sublime
2222
import traceback
2323

24+
from ..plugins.bibliography import * # register internal bibliography plugins
2425
from .latex_fill_all import LatexFillAllPlugin
2526
from .latextools_plugin import get_plugin
2627
from .latextools_plugin import NoSuchPluginException

latextools/make_pdf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import sublime
1818
import sublime_plugin
1919

20+
from ..plugins.builder import * # register internal builder plugins
2021
from .latextools_plugin import classname_to_plugin_name
2122
from .latextools_plugin import get_plugin
2223
from .latextools_plugin import NoSuchPluginException

plugin.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@
131131
LatextoolsToggleKeysCommand
132132
)
133133

134-
from . import plugins
135-
136134

137135
def _filter_func(name):
138136
return name.startswith(prefix) and name != __spec__.name

plugins/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
from .bibliography import *
2-
from .builder import *
3-
from .viewer import *

0 commit comments

Comments
 (0)