HTML – USER TAGSx & USER ATTRIBUTESx
-
Windows 10 – Notepad++ 8.7
Hello,
USER TAGSx
USER TAGS1: The number of tags that can be added is limited. I cannot add any more tags.
USER TAGS2, 3, 4: It is not possible to enter tags.USER ATTRIBUTESx
I could type attributes into USER ATTRIBUTES1 and USER ATTRIBUTES2.
Is there a maximum number of entries?Thank you for your feedback.
Best regards -
USER TAGS1: The number of tags that can be added is limited. I cannot add any more tags.
How many keywords did you try to add to USER TAGS1? I just did an experiment where I added roughly 4000 words, each up to 20 characters long, and it seemed to work fine:
USER TAGS2, 3, 4: It is not possible to enter tags.
Yes it is. See my screenshots – the picture above shows highlighting on four different
peter#
tags, each from a separate user group. it also shows highlighting from the four different user attributes lists as well. USER TAGS1has around 4000 entries.(see below, I pasted in about 4000, but only about 3000 fit because of a 30000-character limit). The screenshots below show the different styles and show which user-defined-keywords go in which USER TAGS#, so you can see based on the full screenshot above plus these ones below that my custom USER TAGS do properly get highlighted when I define them:Is there a maximum number of entries?
When I tried a similar list of ~4000 entries for USER ATTRIBUTES4, it only included about 1500 of them – but I think the limit was probably around 30000 characters instead of the limit being the number of words.
Yeah, I tried again with a000001 - a131073, but when I pasted it in, it only went to about a003749. And yes, the field was truncated to almost exactly 30000 characters, so that seems to be the limit for the USER ATTRIBUTES
I went back to the USER TAGS1, and confirmed it actually also cut off at 30000 characters as well, rather than including all 4000 of my words.
Thus, the limit is each USER TAGS or USER ATTRIBUTES user-defined-keywords box is limited to as many TAGS or ATTRIBUTES keywords as you can fit in thirty thousand characters, which is really big, but not unlimited.
Do you really have more than 4 distinct groups of tags with 30k characters in each group, and/or more than 4 distinct groups of attributes with 30k characters in each group? Is it truly meaningful for you to highlight all of those, and would you even notice if it weren’t highlighting them all?
And, the fact is, that’s 30000-characters times 4 tag groups and 4 attribute groups more than there were before v8.7 (when the extra tag groups were added for the languages that support them). At an average of 10 characters per word (which is pretty high, really), that’s twenty-four thousand more keywords available that you couldn’t have been able to highlight before v8.7.
If that’s not sufficient for you… well, you could put in a feature request to ask Don to allow more than 8 substyles, but I am doubtful that Don would think it worth it (and there will be a cutoff at some point; IIRC, the lexers that enable substyles have an internal limit to the number of substyles).
-
… it’s actually more powerful than that. The 30000 character limit is a limitation of the GUI field, not the syntax highlighter.
If I restart Notepad++, then edit
%AppData%\Notepad++\stylers.xml
and manually edit theUSER TAGS1
entry:<WordsStyle name="USER TAGS1" styleID="192" fgColor="0000FF" bgColor="FFFF80" fontName="" fontStyle="0" fontSize="" keywordClass="substyle1">uk00001 uk00002 ... uk16382 uk16383 uk16384</WordsStyle>
In that example, the
...
refers to all the others… there were a total of 16384 keywords in my actual list (won’t fit in the forum, and is rather pointless to try), with >131000 characters.After I make that change, I save and restart again, then use HTML text like
<!DOCTYPE html> <html> <uk00001></uk00001> <uk08192></uk08192> <uk16384></uk16384> </html>
… where I tried the first, middle, and last keyword in the user-keyword list, and it hightlights all of them:
I was originally planning on a binary search to find out the last keyword that was actually recognized (assuming it was going to be less than 16K), but it recognized all 16K.
So, I tried again with
uk000001
touk131072
, which was over 1 million characters long, and it was still able to recognize keywords from the beginning, middle, and end of the list, so I am confident that it really recognizes any keyword from the list…Thus, each list can accommodate more than one hundred thirty-one thousand keywords (131072) without difficulty, if you’re willing to edit the
stylers.xml
(or yourthemes\XXXX.xml
, if you use a different theme).If you look at the USER TAGS1 User-defined keywords list when it’s got the 131k entries:
…
… you can see all of them. However, it won’t let you add any more in the GUI (because of the 30k character limit of the edit input)Don has often put configurations that he deems “too advanced” or “too niche” for most users into places where you have to edit underlying config files, or add zero-byte files, rather than enabling those in the GUI. So, it’s not unreasonable to expect that a “normal” user would be quite happy with four lists of ~3000 words each entered using the GUI; and if they aren’t satisfied with that, to expect them to become “advanced” enough to learn how to edit the config file themselves.
In conclusion, I really don’t think a feature request is warranted for this: it’s reasonable for normal users using the GUI, and if you need more power, then you can edit the styler/theme file yourself.
(aside: the
uk
prefix wasn’t because I was assuming you were British, nor indicating the same of me; it was my mental shorthand for “User-defined Keyword”) -
Thank you for these figures.
However, I can confirm that it was impossible to enter data in the USER TAGSx fields on my laptop at the time I wrote my message.
After restarting my laptop, it was possible to enter data again.
The reason for the sudden freezing of data entry is a mystery.