def on_close_phantom_and_popup(self, href): """Close all phantoms.""" global mdpop_params mdpopups.erase_phantoms(self.view, 'trans') mdpopups.hide_popup(self.view) if "mdpopups.default_formatting" in mdpop_params: self.system_setting.set( "mdpopups.default_formatting", mdpop_params["mdpopups.default_formatting"]) else: self.system_setting.erase("mdpopups.default_formatting") if "mdpopups.user_css" in mdpop_params: self.system_setting.set("mdpopups.user_css", mdpop_params["mdpopups.user_css"]) else: self.system_setting.erase("mdpopups.user_css") sublime.save_settings("Preferences.sublime-settings")
def run(self, edit): """Run command.""" for x in range(self.view.settings().get('uml.regions', 0)): self.view.erase_regions("uml%d" % x) self.view.settings().set('uml.regions', 0) mdpopups.erase_phantoms(self.view, "uml") self.snippets = [] count = 0 for region in self.view.find_all( r'@startuml[\s\S]*?@enduml|@startdot[\s\S]*?@enddot'): self.snippets.append(self.view.substr(region).encode('utf-8')) self.view.add_regions("uml%d" % count, [region], "", "", sublime.HIDDEN) count += 1 self.view.settings().set('uml.regions', count) sublime.set_timeout_async(self.render, 100)
def run(self, edit): """Run command.""" for x in range(self.view.settings().get('uml.regions', 0)): self.view.erase_regions("uml%d" % x) self.view.settings().set('uml.regions', 0) mdpopups.erase_phantoms(self.view, "uml") self.snippets = [] count = 0 for region in self.view.find_all(r'@startuml[\s\S]*?@enduml|@startdot[\s\S]*?@enddot'): self.snippets.append(self.view.substr(region).encode('utf-8')) self.view.add_regions( "uml%d" % count, [region], "", "", sublime.HIDDEN ) count += 1 self.view.settings().set('uml.regions', count) sublime.set_timeout_async(self.render, 100)
def on_close_phantom(href): """Close all phantoms.""" view = active_view() mdpopups.erase_phantoms(view, 'mdpopups_test')
def run(self): global mdpop_params self.view = self.window.active_view() mdpopups.erase_phantoms(self.view, 'trans') mdpopups.hide_popup(self.view)