• Login
Community
  • Login

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

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
2 Posts 2 Posters 295 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    sesa150162
    last edited by Apr 19, 2021, 9:47 AM

    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

    P 1 Reply Last reply Apr 19, 2021, 1:11 PM Reply Quote 0
    • P
      PeterJones @sesa150162
      last edited by Apr 19, 2021, 1:11 PM

      @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 EnhanceAnyLexer.py 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+§'

      1 Reply Last reply Reply Quote 1
      2 out of 2
      • First post
        2/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors