It seems build systems do not check whether or not their target commands are enabled.
I’m on OS X 10.10.5, using Sublime Text build 3114.
With a build system as follows:
{
"cmd": ["cmd"],
"target": "target"
}
and a target command as follows:
import sublime
import sublime_plugin
class TargetCommand(sublime_plugin.WindowCommand):
def is_enabled(self, cmd=None):
return False
def run(self, cmd=None):
print("TargetCommand ran with %s as the argument." % cmd)
running
>>> window.run_command("build", {"build_system": "Packages/Package/BuildSystem.sublime-build"})
produces
TargetCommand ran with ['cmd'] as the argument.
as output in the console.
Is this behavior intentional?