Home Download Buy Blog Forum Support

sublime-menu documentation?

sublime-menu documentation?

Postby fcgrx on Sat May 04, 2013 2:03 am

is the sublime-menu format documented anywhere? i assume so but i sure can't find it.

more specific question:

how might i add a menu item using my Main.sublime-menu file, and have it be greyed out based on whether or not the current file is of a compatible syntax?

For example, Ive added a menu item for CSS Comb like so:

{ "caption": "CSS Comb", "command": "css_sorter" }

but it's enabled even when the current syntax is PHP.

how do i change that?
Posts: 23
Joined: Sat May 04, 2013 1:58 am

Re: sublime-menu documentation?

Postby skuroda on Sat May 04, 2013 3:55 am

I don't know if it's documented anywhere, but you can create an "is_enabled" method within your command. Returning True or False for if you want it enabled or disabled.
Posts: 692
Joined: Fri Oct 05, 2012 8:11 am

Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 17 guests