<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[I was ambushed by the 63-character limit for plugin menu item names]]></title><description><![CDATA[<p dir="auto"><a href="https://github.com/molsonkiko/JsonToolsNppPlugin/issues/70#issuecomment-2189550175" rel="nofollow ugc">See my comment in this GH issue</a> for more context.</p>
<p dir="auto">TL;DR: I tried to make a menu item that was too long, sometimes it caused Notepad++ to fail to start with no message or anything, and sometimes it just caused the offending menu item to appear mangled. I think Notepad++ does a pretty good job most of the time of trying to let the user know why it’s about to crash, so I was a bit frustrated that I had to do so much poking around to figure out the origin of the issue.</p>
<p dir="auto">I feel pretty strongly that <em>something</em> should be done to communicate this limitation more clearly in the <a href="https://npp-user-manual.org/docs/plugins/" rel="nofollow ugc">user manual</a> or maybe via a message at Notepad++ startup, but I’m not sure what. What do others think? And don’t worry, I won’t be too offended if you think the correct solution is for me to git gud ;)</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/25905/i-was-ambushed-by-the-63-character-limit-for-plugin-menu-item-names</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 20:17:18 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25905.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Jun 2024 17:56:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I was ambushed by the 63-character limit for plugin menu item names on Tue, 25 Jun 2024 19:23:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> said in <a href="/post/95575">I was ambushed by the 63-character limit for plugin menu item names</a>:</p>
<blockquote>
<p dir="auto">Given that the menuItemSize doesn’t affect anything except the size of the Plugins’ menu entries in TCHAR _itemName[menuItemSize], and the equivalent for built-in context menus is generic_string _itemName , which doesn’t have length restrictions, I think it’s worth trying to ask Don to allow for an increase (“Notepad++ menu entries don’t have a length restriction, but Plugin menu entries do” seems a solid argument, to me).</p>
</blockquote>
<p dir="auto">Changing that would break existing plugins. It’s hard-coded into the C interface.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/26710">@Mark-Olson</a><br />
I’m coming a bit off the top of my head here, but I see no way Notepad++ could offer a message, since the length limit is hard-coded into the <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/c54b33db81d5a430a88fc6ce6ebbb2a13761b1eb/PowerEditor/src/MISC/PluginsManager/PluginInterface.h" rel="nofollow ugc">interface structure</a>. If you’re supplying more than 63 characters, you have, by definition, broken the interface.</p>
<p dir="auto">If you hard-coded a character string of more than 63 characters into a C/C++ program using that structure (as I use it <a href="https://github.com/Coises/ColumnsPlusPlus/blob/e7bcf32553aec47e5c6dbdcf06b1b30b20b02f30/src/Plugin.cpp#L72" rel="nofollow ugc">here</a>), you’d get a compile time error.</p>
<p dir="auto">As I understand it, plugins that choose to be translatable must supply their own translation mechanism; Notepad++ doesn’t do anything about that. I believe it must be the translation process in your plugin that is copying a string without checking the acceptable target length first.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/95576</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/95576</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Tue, 25 Jun 2024 19:23:45 GMT</pubDate></item><item><title><![CDATA[Reply to I was ambushed by the 63-character limit for plugin menu item names on Tue, 25 Jun 2024 18:54:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/26710">@Mark-Olson</a> ,</p>
<blockquote>
<p dir="auto">maybe via a message at Notepad++ startup</p>
</blockquote>
<p dir="auto">I don’t think that would be a useful message.  It’s not the <em>users</em> who care, it’s the Plugin authors who need to take note.</p>
<blockquote>
<p dir="auto">communicate this limitation more clearly in the user manual</p>
</blockquote>
<p dir="auto">I think such a note would be pretty “jarring” , since there aren’t any other such low-level hints in the manual.  I’m not 100% opposed, mind you, but before adding a “gotchas” section, I think your comment in the issue is worth thinking about:</p>
<blockquote>
<p dir="auto">and since it’s in the Notepad++ codebase there’s nothing I can do (other than request that it be changed, which likely wouldn’t work)</p>
</blockquote>
<p dir="auto">Given that the <code>menuItemSize</code> doesn’t affect anything except the size of the Plugins’ menu entries in <code>TCHAR _itemName[menuItemSize]</code>, and the equivalent for built-in context menus is <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/84e310911db5388761622de92d6fd6a3813dec9b/PowerEditor/src/WinControls/ContextMenu/ContextMenu.h#L24" rel="nofollow ugc"><code>generic_string _itemName</code></a>, which doesn’t have length restrictions, I think it’s worth trying to ask Don to allow for an increase (“Notepad++ menu entries don’t have a length restriction, but Plugin menu entries do” seems a solid argument, to me).</p>
<p dir="auto">As an aside: Personally, I dislike long menu entry names, and they can usually be rephrased to shorten it.  For example, even in your English from that discussion, “Choose schemas to automatically validate &amp;filename patterns” could be shortened to “Choose &amp;filename-validation schemas”, which is 40% shorter… though still on the long side of what I like in menu entries.  “Verb” or “Verb Object” make the best menu entries, using hierarchy to give context.  So your four schema-related entries could be put under <code>Schema &gt;</code>, with <code>&amp;Validate JSON</code>, <code>Edit &amp;filename patterns</code>, <code>Generate from JSON</code>, and <code>Generate random valid JSON</code>.  (But yes, I know that Notepad++ punishes plugins for putting any actions in sub-menus by not allowing shortcut editing.  That’s another thing that should be changed in Notepad++, but I find it less likely to be fixed than menu-entry length.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/95575</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/95575</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 25 Jun 2024 18:54:38 GMT</pubDate></item></channel></rss>