Home Download Buy Blog Forum Support

Add menu item at end or specific place?

Add menu item at end or specific place?

Postby sublimated on Thu Jan 26, 2012 10:06 pm

Currently, it seems it's only possible to insert a menu item at the top of the menu, e.g.

[
Code: Select all
[
    {
        "caption": "View",
        "mnemonic": "V",
        "id": "view",
        "children":
        [
            { "command": "show_scope" }
        ]
    }
]


If, for example, I want to put the item at the end of the View menu, or place it, say, after Syntax, seems like I have to copy the entire View menu from the Default/Main.sublime-menu, which I don't want to do since it will override changes Jon may make after. Is this how it is or am I missing something?
sublimated
 
Posts: 13
Joined: Sun Dec 18, 2011 3:58 pm

Re: Add menu item at end or specific place?

Postby facelessuser on Thu Jan 26, 2012 10:18 pm

It seems that giving your menu item a unique id will put it at the bottom; don't ask me why.

Code: Select all
[
    {
        "caption": "View",
        "mnemonic": "V",
        "id": "view",
        "children":
        [
            {
                "caption": "Show Scope",
                "command": "show_scope",
                "id": "a_unique_id_goes_here"
            }
        ]
    }
]
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm


Return to Plugin Development

Who is online

Users browsing this forum: Clams, Google [Bot] and 9 guests