When Notepad++ reads in shortcuts.xml, it parses it for content, not its textual makeup, and keeps the content in memory. When it is time to write out shortcuts.xml, it writes out what it has, which no longer has the comments. It makes sense, but I agree it would be better if it would keep the comments.
However, I sort of like your “cheat”. Previously, I would use the sParam string of a command that doesn’t use it for anything to store some comments I wanted to leave. But obviously this cannot be done if a line USES its sParam data for something. Since the NULL operation never uses sParam for anything, it is an excellent place for comment text, following lines that already employ the sParam for something useful. Here’s an example of how “the cheat” could be used:
<Macro name="Mark DUPLICATE LINES (except last occurrence)" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s)^(.*)(?:\R)(?s)(?=.*^\1\R)" /> <Action type="0" message="2172" wParam="0" lParam="0" sParam="2172=NULL(comment): for 1601: here's what the regex does..." /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="276" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1615" sParam="" /> <Action type="0" message="2316" wParam="0" lParam="0" sParam="" /> <Action type="2" message="0" wParam="43006" lParam="0" sParam="" /> </Macro>