-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'show build results only on a failed build' feature #8
base: master
Are you sure you want to change the base?
Conversation
|
||
if build_finished: | ||
errors = self.output_view.find('Error', 0) | ||
if errors == None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at Packages/Default/exec.py, a more robust way to do the error check would be:
errs = self.output_view.find_all_results()
if len(errs) == 0:
Also from the looks of exec.py, it looks like there are on_finished events you may be able to hook into now. |
@jwheare Thanks. It's been a while since I've touched this, but I'll have a look in a bit. |
I would like this feature as well! |
Would be awesome! |
(In ST3) I tried
but it seems the event is not called.
|
I’ve managed to get this working by setting |
@niksy The problem is not to check if there are errors, but the event, See also Sublime Text forum: |
I resolved with the following snippet (for instance,
|
Trying to knock this down with some free time at hand. I've based on @albertosantini's snippet and tried to build this feature based on exit code, at branch SublimeOnSaveBuild/autohide. Would one of you be able to pull the branch and see if it works for you? PS: Apologies for not being able to spend much time on this project in the past. Hope to provide it better care in future. 🙏 |
Thanks for the branch. I tested it, but the exit code is not enough (at least in my use cases).
I added a test if it is displayed some error in the output view. |
Another thought. There are build systems with no errors, but the user wants the output panel opened. Indeed in Build Next plugin I added a preference per build system. |
@albertosantini, I'm curious to know if you are able to get any output from the function Other than the reference to this function in the bundled |
@alexnj for instance, a few details using an eslint build. I added in the snippet above the following lines:
The messages in the console:
The build output:
This is eslint build:
Please, ignore Notice the exit code of the command is 1, but exit code in the snippet is None. |
In ST3 3070 on_post_window_command issue is fixed. From the changelog: API: Fixed on_post_window_command() not getting called |
Hi guys, I would find this option also very useful. Any progress on this? My use case: I have a Jade->HTML build system. I would only want to see resulting log on error. |
I found, that exit code not always match with real. I wish use stdout for analyze. |
if build_finished: | ||
errors = self.output_view.find('Error', 0) | ||
if errors == None: | ||
view.window().run_command("hide_panel", {"panel": "output.exec"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I believe the panel
argument to hide_panel
is a no-op, unlike to its sibling show_panel
. I just tried it out in ST2 and ST3 with the 'find' panel open; the above hide_panel
call would still close the find panel even though the output.exec
panel was specified. Seems https://sublimetext.userecho.com/topics/1930-add-panel-param-to-hide_panel-command/ is still open. @wbond, correct?
Can we get this feature implemented? |
... |
This was a request from Issue #1 that I went ahead and implemented.
One decision I made was to not show the build output at all if the build was successful. I'm not sure if this is ideal, and would be happy to do the reverse (hide the window once the build succeeds).
Feel free to complain and tell me to rewrite, change, etc.