diff --git a/MarkdownLivePreview.py b/MarkdownLivePreview.py index 8ce1074..15ab19d 100644 --- a/MarkdownLivePreview.py +++ b/MarkdownLivePreview.py @@ -11,6 +11,14 @@ from .functions import * class MarkdownLivePreviewListener(sublime_plugin.EventListener): + def on_modified(self, view): + window = view.window() + vsettings = view.settings() + if vsettings.get(PREVIEW_ENABLED): + id = vsettings.get(PREVIEW_ID) + if id is None or get_view_from_id(window, id) is None: + preview = create_preview(view) + def on_activated(self, view): # if view is md_view and has no preview # -> create preview diff --git a/sample.md b/sample.md index 3251cc7..91b2cf3 100644 --- a/sample.md +++ b/sample.md @@ -1,7 +1,7 @@ -# DuckDuckGo - The Search engine you'll fall in love with +# DuckDuckGo - The Search engine you'll fall in love with ![image](http://afterishtar.pl/images/100x100.gif) - + this is a test hello world... \ No newline at end of file