Sublime Forum

Build System enhancements

#1

My requests for some enhancements in the Build System, some of them was already asked long time ago:

  • Add an argument in the .sublime-build to set the height of the panel (in percent of window height). In addition an API to change the height of panel would be great.
  • Add a “name” argument for the default build, not only the variants. It will be used in place of “Build: Build”. This argument is already used by build system defined in project, but I don’t think it’s an issue.
  • Remove “Build: Cancel” from Command Palette when not needed (like the corresponding item in the main menu)
  • Add an argument “show_panel_on_build” in the .sublime-build, to override the global settings.

In addition:

  • Add an argument “show_panel_on_build_only_on_error” in the .sublime-build to only show the panel when there’s an error (using “line_regex” or maybe the exit code).
  • If a build command without a variant name is triggered and the .sublime-build don’t have a default build, automatically open the Command Palette with “Build:” (currently it trigger an error cos “cmd” is empty). Useful when you have many build variants without any one that is default (like running a SQL script on a database, you have 10 different database (variants) and want to always choose the one you want when running build):

[code]execmod = import(“exec”)

class ExecCommand(execmod.ExecCommand):
def run(self, cmd=], *args, **kwargs):
if not cmd and not kwargs.get(“kill”, False):
# if cmd is empty, open the command_palette with the available build list
self.window.run_command(“show_overlay”, {“overlay”: “command_palette”, “text”: "Build: " + kwargs.get(“prefix”, “”)})
else:
# if there is a cmd, run the standard exec command
super(ExecCommand, self).run(cmd, *args, **kwargs)[/code]

Thanks for reading.

1 Like

Fast switching of build systems
Multi task Builder
Build Systems
#2

bump.
The current Build System is very basic, I think these additions make it a lot more usable, at least for me.
Please Jon if you don’t consider implementing these requests, give me an answer.
At least I could try to implement them myself (for the things that doesn’t need new API methods).

0 Likes