ahkscript / SublimeAutoHotkey

AutoHotkey AHK language package for SublimeText including syntax highlighting, comments toggling, auto-completions, build system definitions, commands for ahkrun, ahkcompile, ahkrunpiped.
The Unlicense
207 stars 43 forks source link

[Feature request] AutoHotkey output panel hide #40

Closed Kristinita closed 7 years ago

Kristinita commented 7 years ago

Request

It would be nice, if you add opportunity hide AutoHotkey panel, if script run was successfully.

Justification

I need hide panel manually, I spend time on it.

Steps for reproduce

I install AutoHotkey → I install and configure SublimeAutoHotkey → I create any ahk file, for example:

:R*:/Sasha::Sasha is amazing!

Ctrl+Shift+PAutoHotkey - Run → if script successful run, output panel not hide for me.

Actual behavior

Possible solution

See answer of BuildNext plugin owner.

        exit_code = proc.exit_code()
        errors_len = len(self.output_view.find_all_results())

        if (exit_code != None and exit_code != 0) or errors_len > 0:
            self.window.run_command("show_panel", {"panel": "output.exec"})
        else:
            self.window.run_command("hide_panel", {"panel": "output.exec"})

Thanks.

davebrny commented 7 years ago

i would like to see this added as well.
in the meantime, you could use this if you dont mind using a hotkey instead of the command palette:

#ifWinActive ahk_class PX_WINDOW_CLASS

^!r::
winMenuSelectItem, ahk_class PX_WINDOW_CLASS, , Tools, Autohotkey - Run
send {esc}
return

#ifWinActive