Sublime Forum

.sublime-menu when specifix syntax(es)

#1

Hey guys,

i am kind of confused of the sublime-menus. I want to display a button IF the current syntax is “Packages/PHP/PHP.tmLanguage”, is there a way to define this in the sublime-menu file?

Thats my file so far:

[code]
{
“caption”:“Instant Execute”,
“children”:

        {
        	"command": "instant_execute",
        	"caption": "PHP"
        }
    ] 
}

][/code]

Hope there is a Solution for this!

Regards, Philipp

0 Likes

#2

[code]class InstantExecuteCommand(sublime_plugin.WindowCommand):
def run(self):
…something…

def is_visible(self):
	view = sublime.active_window().active_view()
	if view:
		return view.settings().get('syntax') == 'Packages/PHP/PHP.tmLanguage'[/code]
0 Likes

#3

This is awesome, thank you verry much!

0 Likes