Sublime Forum

Bug / Request - Correct the missing ids in the menu files

#1

I found this issue while browsing the menu files and I used it to make a point regarding a company which has been actively slandering my good name for reporting a bug in third party software…

Because it should be fixed, and would benefit all - I am submitting this here.

Right now, a lot of the menus have ids associated with this - this means if someone wants to create a nested menu, they can simply by referencing the ID. They can even leave out the caption, etc… ( which is for the best )…

For instance, a clean main menu file for a plugin could look like:

//
// Main Menu - Adds entries the primary Sublime Text Menu - Josh 'Acecool' Moser
//
[




	//
	// File Menu
	//
	{
		"id": "file",
		"children":
		[
			//
			// Settings File - Default / Empty
			//



						{
							"caption": "Open Recent",
							"children":
							[
								{ "command": "reopen_last_5_files", "caption": "Reopen the 5 last Closed Files" },
								{ "caption": "-" },
							],
						},


		],
	},


	//
	// Edit Menu
	//
	{
		"id": "edit",
		"children":
		[

		],
	},


	//
	// Selection Menu
	//
	{
		"id": "selection",
		"children":
		[

		],
	},


	//
	// Find Menu
	//
	{
		"id": "find",
		"children":
		[

		],
	},


	//
	// View Menu
	//
	{
		"id": "view",
		"children":
		[

		],
	},


	//
	// Goto Menu
	//
	{
		"id": "goto",
		"children":
		[

		],
	},



	//
	// Tools Menus
	//
	{
		"id": "tools",
		"children":
		[
			{ "caption": "-" },
			{
				"id": "packages",

				//
				"children":
				[
					{
						//
						"caption": "Acecool's - edit_settings_plus - Tools",

						//
						"children":
						[
							{ "caption": "-", },
							{ "command": "edit_settings_plus_show_all_expandable_vars_simple" },
							{ "command": "edit_settings_plus_show_all_expandable_vars" },
						],
					},
				],
			},
		],
	},



	//
	// Goto Menu
	//
	{
		"caption": "Project",
		// "mnemonic": "P",
		"id": "project",
		"children":
		[

		],
	},


	//
	// Preferences Menu
	//
	{
		"id": "preferences",
		"children":
		[
			// Open all default files...
			{ "caption": "Sublime - Open all Settings / Keybinds / Mousemaps", "command": "edit_settings_plus", "args": { "open_defaults": true } },

			// Open all of the default menu files... I am thinking of looking through the current package to find these filenames... we'll see..
			{ "caption": "Sublime - Open All Menu Files", "command": "edit_settings_plus", "args": { "open_menu": true } },

			{ "caption": "-" },
			{
				"id": "package-settings",

				//
				"children":
				[
					{
						//
						"caption": "edit_settings_plus",

						//
						"children":
						[
							{ "caption": "Sublime - Open All Menu Files", "command": "edit_settings_plus", "args": { "open_menu": true } },
							{ "caption": "Sublime - Open all Settings / Keybinds / Mousemaps", "command": "edit_settings_plus", "args": { "open_defaults": true } },


						],
					},
				],
			},
		],
	},



	//
	// Help Menu
	//
	{
		"id": "help",
		"children":
		[
			{ "caption": "-" },
			{
				// Since I added this - I added a caption, but this should be a default...
				"caption": "Package Help",
				"id": "package-help",

				//
				"children":
				[
					{
						//
						"caption": "Acecool's - edit_settings_plus - Help",

						//
						"children":
						[
							{ "caption": "Getting Started", "command": "open_url", "args": { "url": "https://bitbucket.org/Acecool/AcecoolCodeMappingSystem/src/master/readme.md" } },
							{ "caption": "-" },
							{ "caption": "Report Issue", "command": "open_url", "args": { "url": "https://bitbucket.org/Acecool/AcecoolCodeMappingSystem/issues/new" } },
							{ "caption": "Request Feature", "command": "open_url", "args": { "url": "https://bitbucket.org/Acecool/AcecoolCodeMappingSystem/issues/new" } },
							{ "caption": "-", },
						],
					},

				],
			},


		],
	},
]

I left in a suggestion at the end - Package Help underneath the help menu, id package-help.

Another suggestion is to add an id to the open-recent menu.

The nice thing about this merge menu system is that modders can add menus to the main menu, or any nested menu within. But if there is a problem with the structure ( such as a missing id ), or missing folders ( which could be beneficial ) then the modders have to create them.

The issue with this, is their coding standard bias creeps into it. If it gets picked up and other modders start using it, then it’ll be hard to correct.

Also, if the id is not there in the default file, it means a duplicate menu is created.

So my suggestion / request is to add ids to each and every single nested menu, and to add a packages help menu under help. Maybe even a Package Tools menu under tools. Maybe a few others too so that modders can put configuration in one place, access to tools in one place, access to help, etc… in another, and so on.

EDIT: Currently working on a BLANK menu for modders…

Here are the current menus that lack an id.

under File > // Note: You can not access any nested menus in the File menu. Even if you copy / paste the default menu contents - all of the entries are duplicated.
	open recent
	re-open with encoding
	save with encoding

under Edit > // Note: Same seems true for this...


	Basically all....

Update for list above - apparently a lot of these nested paths can not be merged. Even if you copy / paste the original file into a new file - all of the menus are 100% duplicated. Even if you remove the commands and only leave the menus, these are duplicated at the bottom.

If you re-add the mnemonic and / or caption then it appears in the middle ( for File )…

In short - I’d love to see this system improved so that if you put something BEFORE something with an id, then it appears before that element with the id. If the next id matches, then it tries to merge, or if they are the same it serves as a placeholder for non-default files.

I am able to merge easily in the preferences, project, tools, help menus for other menus and it works great. The other menus I have to add my own stuff and I may then be able to merge into that stuff - but it would require ALL modders to be on the same page ( not easy ) if something is added.

Generally, I won’t add something to the main menu unless I think it can be useful there. Although my mod did add some in a few places as feelers. But I think I’ll stick with preferences, hep, project, and tools for the most of them, however I do have edit and selection tasks to add, and maybe even file tasks ( auto generation of wiki content based on data within, etc… ) so being able to merge would be nice.

Note: Commands that can be replaced should also contain ids - however, it is unlikely ANY of these SHOULD contain ids… For instance, if someone overwrote exit with something else, that could be a problem.

But the menus should have ids. I would also love to see groups within menus… ie: a way to list how high up or low an item appears…

ie: In the file menu, always have New, Save, Open, etc… at the top. Always have EXIT at the bottom.

Or, always put plugin additions at the bottom.

Edit: It actually does seem like you have a way to organize… the captions with ids… I missed this… edit: It seems as though the ids for these are skipped… Also, a lot of menus do not get merged leading me to consider the merging system isn’t id based, however I have been able to merge into menus created by other authors as a test…

So the order must be off, or something is slightly off to cause the issue…

0 Likes