RE: UDL, Styler is not related to the Group below
-
I’ve been trying to customize an existing UDL and I’m finding that the ‘Styler’ settings are affecting keywords in other groups and even other groups in other tabs. This makes it very painful to make adjustments as I have to check out all the ‘Styler’ boxes and flipping underline off and on to see what keywords are affected.
Has anyone seen this or know how to fix it? One option I haven’t tried is to just start from scratch to see if there is an issue with the UDL. FYI, the UDL I started with is gedcom5.5.Thanks for your help.
-
@spydermcfly ,
Hopefully someone with better knowledge can help you, but looking at the code for UDL it looks like it’s using default styling. Which is controlled by the Style Configurator in the Settings menu.For example, in the NPP depository, the gedcom55 Styles tag looks like this:
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="11" /> <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="0000FF" bgColor="FFFFFF" fontName="Arial Unicode MS" fontStyle="0" fontSize="8" /> <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="00FF40" bgColor="FFFFFF" fontName="Arial Unicode MS" fontStyle="0" fontSize="10" /> <WordsStyle name="KEYWORD1" styleID="5" fgColor="000000" bgColor="8080FF" fontName="" fontStyle="0" /> <WordsStyle name="KEYWORD2" styleID="6" fgColor="FFFF00" bgColor="808080" fontName="" fontStyle="0" /> <WordsStyle name="KEYWORD3" styleID="7" fgColor="808040" bgColor="FFFF00" fontName="" fontStyle="0" /> <WordsStyle name="KEYWORD4" styleID="8" fgColor="FFFFFF" bgColor="000000" fontName="" fontStyle="0" /> <WordsStyle name="COMMENT" styleID="1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" /> <WordsStyle name="COMMENT LINE" styleID="2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" /> <WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" /> <WordsStyle name="OPERATOR" styleID="10" fgColor="FFFF00" bgColor="000000" fontName="" fontStyle="0" /> <WordsStyle name="DELIMINER1" styleID="14" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" /> <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" /> <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
In my UDL, after disabling all the Globally selectable stylers on the front page of the Style Configurator, my UDL Styles section looks like this:
<WordsStyle name="DEFAULT" fgColor="FFFF00" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="0" /> <WordsStyle name="COMMENTS" fgColor="00FF00" bgColor="FFFFFF" colorStyle="1" fontName="Source Code Pro" fontStyle="2" fontSize="11" nesting="0" /> <WordsStyle name="LINE COMMENTS" fgColor="00FF00" bgColor="808080" colorStyle="1" fontName="Source Code Pro" fontStyle="2" fontSize="11" nesting="0" /> <WordsStyle name="NUMBERS" fgColor="00FFFF" bgColor="FFFFFF" colorStyle="1" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="0" /> <WordsStyle name="KEYWORDS1" fgColor="FFFFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="1" fontSize="11" nesting="0" /> <WordsStyle name="KEYWORDS2" fgColor="FFFFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="1" fontSize="11" nesting="0" /> <WordsStyle name="KEYWORDS3" fgColor="FFFFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="1" fontSize="11" nesting="0" /> <WordsStyle name="KEYWORDS4" fgColor="00FFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="1" fontSize="11" nesting="0" /> <WordsStyle name="KEYWORDS5" fgColor="FFFFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="1" fontSize="11" nesting="0" /> <WordsStyle name="KEYWORDS6" fgColor="00FFFF" bgColor="FFFFFF" colorStyle="1" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="0" /> <WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" /> <WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" /> <WordsStyle name="OPERATORS" fgColor="FFFFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="0" /> <WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontName="Source Code Pro" fontStyle="1" fontSize="11" nesting="0" /> <WordsStyle name="FOLDER IN CODE2" fgColor="FFFFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="1" fontSize="11" nesting="0" /> <WordsStyle name="FOLDER IN COMMENT" fgColor="FFFFFF" bgColor="000000" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="0" /> <WordsStyle name="DELIMITERS1" fgColor="00FFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="33554480" /> <WordsStyle name="DELIMITERS2" fgColor="FFFFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="1" fontSize="11" nesting="83898386" /> <WordsStyle name="DELIMITERS3" fgColor="FFFFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="16777255" /> <WordsStyle name="DELIMITERS4" fgColor="00FF00" bgColor="FFFFFF" colorStyle="1" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="0" /> <WordsStyle name="DELIMITERS5" fgColor="00FFFF" bgColor="000000" colorStyle="1" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="0" /> <WordsStyle name="DELIMITERS6" fgColor="FFFFFF" bgColor="FFFFFF" colorStyle="1" fontName="Source Code Pro" fontStyle="0" fontSize="11" nesting="67108864" /> <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" /> <WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
Notice mine doesn’t have one styleID tag in it. I think that may be what you’re running up against. When you change the Style Configurator, you’re changing the Global settings. All those stock language have their own control, but UDL’s do not. You want to disable all the global controls so you can set all your own colors etc, but beware, it’s a harder job avoiding collisions and getting things to work right…but worth it, in the long run, short of writing your own lexer. :)
-
@spydermcfly said in RE: UDL, Styler is not related to the Group below:
FYI, the UDL I started with is gedcom5.5.
That may be the problem: that UDL from the UDL repository was last updated in 2010 – it uses the old syntax for storing the UDL information; modern Notepad++ still tries to interpret that syntax, but it may not be perfect when it translates it to the modern definition.
One option I haven’t tried is to just start from scratch
That would probably be a good idea. It should be easy enough to copy the four lists of keywords from that XML file into the modern UDL dialog – it should only take a few minutes to re-create it. If you do get a working gedcom UDL for modern Notepad++, feel free to submit it to the UDL repository, as it would be good to have a modern/working version there.
-
FYI,
Over this weekend, I spent some time and converted all the remaining UDL1-style UDL config files in the User Defined Languages Collection to equivalent UDL2.1 config files, making sure that all the elements were mapped to the correct UDL2.1 element. I have also added validation to the Collection so that no more old-style UDL definitions will be accepted into the Collection.
So it should work better when people download some of those older UDLs now.