Sublime Forum

Build System Bug?

#1

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?

1 Like

#2

same behavior in Windows 7 with ST3 3120. I’m guessing that the scope selector is normally considered enough to determine whether a build system is applicable or not.

What is your use case, out of interest?

It might be worth reporting it here: https://github.com/SublimeTextIssues/Core/issues

0 Likes

#3

I was just working on my own version of exec.py and didnt want multiple instances of the plugin trying to run simultaneously in the same window. And good idea, just reported it.

1 Like