sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
804 stars 39 forks source link

Build systems do not check whether or not their target commands are enabled #1298

Open ghost opened 8 years ago

ghost commented 8 years ago

Summary

Build systems do not check whether or not their target commands are enabled.

Expected behavior

Build systems check whether or not their target commands are enabled.

Actual behavior

Build systems do not check whether or not their target commands are enabled.

Steps to reproduce

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.

Environment

keith-hall commented 8 years ago

also confirmed on Windows 7 and Linux (Ubuntu 16.04) with build 3120.