Created
November 21, 2019 08:58
-
-
Save frou/22101b2abafb3d4085769d715cb16516 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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