Menu

Add a new color function for an existant lang

2008-03-18
2012-11-13
  • Nobody/Anonymous

    Hello !

    I'd like to add a style for a language in the styler configurator (Settings > Styler configurator... > Style).

    For example, I'd like to add a style "FUNC" for the PHP language and I put the PHP's functions in this style. It's to not confuse these functions with the users' functions.
    I know it's possible to add words in the textbox for the "WORD" style, but I'd like to avoid mix up reserved words and functions.

    So I started up modify the XML file nammed stylers.xml in the folder :
    C:\Documents and Settings\%user%\Application Data\Notepad++\

    I added this line :
    <WordsStyle name="FUNC" styleID="165" fgColor="800000" bgColor="FEFCF5" fontName="" fontStyle="1" fontSize="" keywordClass="instre2"></WordsStyle>

    in the tag for the PHP.

    When I open the styler configurator and select the PHP language, the "FUNC" style appears correctly. If I add words in the textbox, they correctly appear in the XML file, but they are not colorful as the same as the "WORD" style.

    Do I forgotten anything ?

    Thank you and sorry for my english ...

     
    • Nobody/Anonymous

      So there is no simply way to do this, too bad. Thanks !

       
    • Nobody/Anonymous

      Its doesnt work because the lexer only makes use of predefined styleID's, and 165 isnt one of them. Only the ones you see defined are being used. You have to make a custom language to make it work (either userdefined or by plugin)