For example, I was trying to find out how the toggle_comment command referred to in Main.sublime-menu connects to the ToggleCommentCommand in comment.py. I made my own file named test.py and renamed ToggleCommentCommand to ToggleCommentTestCommand. I added a menu item that was an exact copy of the Comment menu item, but I changed the names to match the names in my test.py file:
- Code: Select all
{
"caption": "Test",
"id": "test",
"children":
[
{ "command": "toggle_comment_test", "args": {"block": false}, "caption": "Toggle Comment" },
{ "command": "toggle_comment_test", "args": {"block": true}, "caption": "Toggle Block Comment" }
]
},
The menu items get added but they are grayed out. If I use the "toggle_comment" command instead, they work.
I can't figure out how ToggleCommentCommand gets connected up to toggle_comment. Could someone explain it?