Skip to content

Instantly share code, notes, and snippets.

@frou
Created November 21, 2019 08:58
Show Gist options
  • Save frou/22101b2abafb3d4085769d715cb16516 to your computer and use it in GitHub Desktop.
Save frou/22101b2abafb3d4085769d715cb16516 to your computer and use it in GitHub Desktop.
import sublime
from Default.exec import ExecCommand
class MyExec(ExecCommand):
# Overrides --------------------------------------------------
def run(self, **kwargs):
super().run(**kwargs)
self.hide_after_success = kwargs.get("hide_after_success", True)
def finish(self, proc):
super().finish(proc)
if self.hide_after_success:
exit_code = proc.exit_code()
exit_success = exit_code == 0 or exit_code is None
if exit_success:
# Automatically hide the results panel momentarily.
sublime.set_timeout(self.hide_build_results, 1500)
# ------------------------------------------------------------
def hide_build_results(self):
if self.window.active_panel() == "output.exec":
self.window.run_command("hide_panel")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment