网网腾科技feat: initial commit
d5a81bebAdd on 2 days agoHistory
"""Command to close Markdown preview."""

import sublime_plugin
from ..preview.manager import PreviewManager


class SmpClosePreviewCommand(sublime_plugin.TextCommand):
    """Closes the Markdown preview for the active view."""

    def run(self, edit):
        manager = PreviewManager.get_instance()
        manager.close_preview(self.view)

    def is_enabled(self):
        manager = PreviewManager.get_instance()
        return manager.has_session(self.view.id())