Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to allow phantoms to be cleanly reloaded
Should permit package to be upgraded without necessarily requiring a restart. Extra effort has to be made to clear any existing phantoms and clear out the references to the listeners which are otherwise not properly cleared.
- Loading branch information
Showing
6 changed files
with
95 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# | ||
# On reload, this module will attempt to remove any phantoms associated | ||
# with ViewEventListeners from all active views. | ||
# | ||
import sublime | ||
import sublime_plugin | ||
|
||
if sublime.version() > '3118' and sublime_plugin.api_ready: | ||
for w in sublime.windows(): | ||
for v in w.views(): | ||
if v.score_selector(0, 'text.tex.latex') == 0: | ||
continue | ||
v.erase_phantoms('preview_math') | ||
v.erase_phantoms('preview_image') | ||
v.settings().clear_on_change('preview_math') | ||
v.settings().clear_on_change('preview_image') | ||
s = sublime.load_settings('LaTeXTools.sublime-settings') | ||
s.clear_on_change('preview_math') | ||
s.clear_on_change('preview_image') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters