francostellari/NppPlugins

Language Help - Customizing contextMenu.xml causes context menu items to disappear

Opened this issue · 1 comments

mileso commented

I did some customization of my contextMenu.xml file (by selecting in "Edit popup context menu" under the Settings menu item) and the Language Help menu items no longer appear. Unchecking and checking the "Show entry in context menu" option had no effect. Finally, I figured out that the plugin is looking for a specific menu item. By placing <Item MenuEntryName="Edit" MenuItemName="Cut"/> as the first item in the context menu restored the Language Help menu items (when "At the top of the menu" was selected). It would be useful to have this requirement documented. [Feature Request] Or an option to specify the name of a menu item to use as an anchor along with the option to place Language Help menu items before or after that specified menu item.

Hi, it's difficult for a plugin to determine if a context menu or a tab menu, or a main menu popup menu has been opened.
My solution is to go by it's content.
The context menu is identified by the presence of >3 of
IDM_EDIT_CUT, IDM_EDIT_COPY, IDM_EDIT_PASTE, IDM_EDIT_DELETE, IDM_EDIT_UPPERCASE, IDM_EDIT_LOWERCASE, IDM_EDIT_BLOCK_COMMENT_SET, IDM_EDIT_BLOCK_UNCOMMENT, IDM_VIEW_HIDELINES
Heavy editing of the context menu will hamper it.
I think that, more than providing a config to list your own, it would be good to read the context menu xml, I guess. Is it really worth the effort?