Defining own language - operators/comment style issue using the '§' sign

  • I’ m having an issue adding styling for a custom language
    The issue :
    I want to add Syntax highlight for all operators starting and stopping with a ‘§’ sign , like : §operator§ §text§ §abcdefg§

    I’ve tried to add the § sign as Open and Close character in Operator style section as a Delimiter style but it seems that the specific § sign does not work .

    I also tried by using Comment Style Open and Close but with same result .

    I can use § in prefixmode in Keyword list but that does only tell if I am using it in the beginning , not that it has a § as a close sign.

    I would be more than happy if anyone can find a solution for my issue

  • @sesa150162 ,

    Unfortunately, the § is at codepoint U+00A7, which is outside the range that UDL officially supports (it is only guaranteed to work with U+0020 to U+007F). There have been at least two issues (#6014 and #8562) requesting Unicode support in UDL, but UDL doesn’t get much attention, so they remain open.

    As a workaround, you can add extra highlighting to a builtin lexer or to your User Defined Language (UDL) using regexes via the script that @Ekopalypse shares in his github repo. Since the matching is done on the Python side, it has full Python 2.7 support for Unicode strings, so you should be able to define your regex inside that script like u'§\w+§' or maybe r'§\w+§'

Log in to reply