Community
    • Login

    Styling '

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 2 Posters 344 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.
    • BGM CoderB
      BGM Coder
      last edited by

      In my UDL, I’m having trouble getting &#39 to style.

      I tried using &# as a keyword in prefix mode, but nothing happens.

      And I tried it for a number, prefix1: &# and suffix1: ; but it still doesn’t colour.

      And I don’t even have & or # defined as operators.

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

        @BGM-Coder ,

        For numbers, it can work, either as prefix2:

        21d3794a-0cd9-482b-b3d1-19ca52e47281-image.png

        or as prefix1:

        d0d201ac-9f01-453b-b47f-a9905e189023-image.png

        I also took it out of both numeric prefixes, and moved it to keyword1 in prefix mode, and it worked correctly for me:

        d774986e-367b-4a29-929a-34ba7b4f2cb6-image.png

        (Side experiment: to get both &# and & to work as number-prefixes in the same category, you have to order it as &# &. In keyword, it didn’t matter, probably because &# matches &-prefix anyway. In numbers, it matters, because # wasn’t an “extra” numeric character)

        Can you show us a minimal example? (Create a brand new UDL – or just use the default “user defined” – assign the active document to User Defined, and show the screenshot of both your text and the relevant UDL-dialog entry, like I did (if UDL is floating, like mine was, you can use Snipping Tool / Win+Shift+S to grab both text and UDL at once; if UDL docked, a simple Alt+PrintScreen will grab everything you need)

        here is the example text I was using.

        0x59
        &39
        &#39
        prefix1 2# 8# 10#
        prefix1 2#111 8#777 10#999
        prefix2 16# 0x 0X
        prefix2 16#999 0xFFF 0X9FF
        extras 1: A B C D E F a b c d e f _ :
        

        I set the keyword1 to burgandy/red, and the numeric to bold green

        1 Reply Last reply Reply Quote 0
        • BGM CoderB
          BGM Coder
          last edited by

          Thanks, Peter.

          You know, it works easily as a keyword in a fresh UDL, but not in my squiffy UDL. I can’t figure it out. There’s not even much in the UDL.

          Here’s my UDL file.

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

            @BGM-Coder said in Styling ':

            not in my squiffy UDL

            Works for me. Well, the UDL you linked didn’t define &# as a prefix-keyword. So I added it to keyword4, and it highlighted just fine:

            ce6ff7ac-4455-46b9-8778-9e0a9fa94fcb-image.png

            I added some of your other keywords, to prove the other squiffy keywords were also highlighting for me. But the critical thing is that &#39 is highlighted red, matching the definition of keyword4

            Or, if you’d prefer it to count as a number:
            18d2b7b7-4ec7-4257-a6d0-d5c3e1e58665-image.png

            Either work for me, starting with your UDL xml that I downloaded from the link you shared.

            Maybe you need to delete your SquiffyUDL.xml, exit Notepad++, download a fresh copy into your UDL folder, and reload Notepad++ (maybe it got “stuck” somehow). Or maybe there’s an example set of data that doesn’t work, whereas the data I show does work – maybe there’s some contextual problem with your exact sequence of data that makes it not work, even though it works with my example data.

            1 Reply Last reply Reply Quote 1
            • BGM CoderB
              BGM Coder
              last edited by

              You know what? I’m usually tech support for people, and they come and tell me that something isn’t working. I ask them to show me, and then they can’t get it to not work.

              Now I spent an hour trying to get that to work in my UDL, but it would not colour no matter what I did.

              But just now, on a whim, after reading that it worked for you, I went and stuck &# in the exact same place I had tried it before (I like it in Styler 3 just below the @) and it just worked.

              I have no explanation why except that I deserve every bit of my frustration for whatever I have done in my life so far.

              Now it’s working for some reason! haaaaaaaaaahhhhhaaaaa

              1 Reply Last reply Reply Quote 2
              • BGM CoderB
                BGM Coder
                last edited by

                Oh - thanks, Peter, for your time and for looking at it for me!

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