This package adds a few methods to atom.contextMenu and allows you to specify commands to remove from the context menu in a similar way to adding commands
There are two ways you can remove context menu items with this package:
atom.contextMenu.remove()
in your init scriptatom.contextMenu.remove {"atom-text-editor": ["Undo","Redo",{label: "Tabs to spaces",submenu: ["Tabify","Untabify","Untabify All"]}]}
"*":"context-menu-remove":remove:"atom-text-editor": ["Undo","Redo",{label: "Tabs to spaces",submenu: ["Tabify","Untabify","Untabify All"]}]
The format is similar to atom.contextMenu.add with a few exceptions.
The only properties that are used are label
and submenu
.
If the item does not have a submenu then you can use the label
property or just use a string.
{ label: "Undo" } === "Undo"
If the you want to remove an item that has a submenu you must list all submenu items.
{label: "Tabs to spaces",submenu: [#"Tabify", #leave Tabify in menu"Untabify","Untabify All"]}
These are the extra methods that are added to atom.contextMenu
This will remove items from the context menu using the format described above.
This will list the selectors that have a label as a top level or submenu item. This is good for debugging.
This will list the items for a given element. This helps when removing multiple items from an element's context menu.
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.