diff --git a/plugins/html-preview/html_preview_plugin/__init__.py b/plugins/html-preview/html_preview_plugin/__init__.py index 5b51a4f6f0eaa02e5ecb68f59c57acc2aa77701e..bd8fc7c0eae94f7276c1bb97f381cbf5a1dbae1e 100644 --- a/plugins/html-preview/html_preview_plugin/__init__.py +++ b/plugins/html-preview/html_preview_plugin/__init__.py @@ -273,6 +273,12 @@ class HtmlPreviewAddin(GObject.Object, Ide.EditorViewAddin): stack = view.get_ancestor(Ide.LayoutStack) stack.add(web_view) + self.action.set_enabled(False) + web_view.connect('destroy', lambda *_: self.web_view_destroyed(web_view)) + + def web_view_destroyed(self, web_view): + self.action.set_enabled(True) + def search_sphinx_base_dir(self, path): context = self.workbench.get_context() vcs = context.get_vcs()