Community
    • Login

    UDL comment line style : long dash ( – ) symbol

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 500 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.
    • Mustang MustangM
      Mustang Mustang
      last edited by

      I’m trying to use the long dash ( – ) symbol. (copy from MS WORD – )
      The style doesn’t work. How can I fix it?
      A short dash - works.
      v8.4.4

      Image 087.png

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Mustang Mustang
        last edited by

        @Mustang-Mustang ,

        Weird. In the comment open/close, – does not work. I just tried some experiments: For a UTF8-encoded file, – works as a keyword, but not as folding or comment or operator or delimiter.

        However, if you change your file to ANSI encoding (because – is a character in Win-1252, which for the US is the default “ANSI” character set), then it will work in any of those slots.

        This is because the UDL was defined with ANSI encoding in mind, and despite years of requests to update the UDL lexer to allow any unicode character and/or to follow the encoding of the current file instead of assuming ANSI-only, that feature has never been added to UDL.

        So, you can “fix” it by encoding your file as ANSI. But that’s an evil fix.

        I believe you can use any properly encoded character in the Enhance Any Lexer plugin. Yep, it recognizes – properly. Install that plugin, and do a section that’s named after your active udl (use a section header of [aaa4] in your example), and define a color = regex pair – for example, 0x0000FF = –.*?– will make everything from – to – show up red when aaa4 UDL is active. (Enhance Any Lexer doesn’t do background colors, but if you want it to change only the foreground, that will work for you)
        f69c109a-d751-41dc-aa5b-b1a50a81ab67-image.png

        1 Reply Last reply Reply Quote 2
        • Mustang MustangM
          Mustang Mustang
          last edited by

          Thanks for the hint, I think the EnhanceAnyLexer plugin is what I need and it will help. It would be better to improve UDL and include any UTF character or even emoji there, and even better its own regex rules.

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