Community
    • Login

    strings starting with ";" ignored when given in codeblock start/end string definition

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    11 Posts 2 Posters 673 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.
    • PeterJonesP
      PeterJones @waskoma
      last edited by

      @waskoma ,

      You will have to be more specific. Are you talking about User Defined Language (UDL), or something else? What do you mean by “ignored”? Could you show some example screenshots (Alt+PrintScreen or Windows Snip&Sketch, then paste into your reply) and put some example text that we can copy/paste so that we can replicate whether or not it is “ignored” for us. If it is a UDL, also show screenshots of your applicable UDL definition settings, so that we can try to replicate. Also, share your ?-menu’s Debug Info so we know which version you are on.

      But my first guess is that you’ve just done something subtly different compared to how you did it in the “old notepad++” (whichever version that might be) compared to how you’re doing it now – maybe there’s some setting you forgot to set in the new version.

      waskomaW 1 Reply Last reply Reply Quote 0
      • waskomaW
        waskoma @PeterJones
        last edited by waskoma

        @PeterJones Thank you for your reply! :)

        yes it is a user defined language, here is a screenshot, this works:

        ![alt text]![c09934be-f413-4f69-b6ae-2de1431ef2fa-image.png]815ebfe4-ac45-4a86-9a30-70c4ff625afb-image.png (/assets/uploads/files/1684522990486-c09934be-f413-4f69-b6ae-2de1431ef2fa-image.png) (image url)

        and this doesnt work because of the “;”

        ![alt text]22dfd9d8-c3e5-42ee-8baf-1c0c822801d8-image.png (image url)

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

          @waskoma said in strings starting with “;” ignored when given in codeblock start/end string definition:

          this doesnt work because of the “;”

          Right. If you have a semicolon in the UDL Open/Close boxes, then you have to have a semicolon in your source code, otherwise it won’t match. Why would you expect the syntax highlighter to see ;blockbegin in the UDL definition and somehow match that to just blockbegin in the source code text file? It looks for the whole term from the UDL box when searching in your text, and if the whole term isn’t in your text file, it won’t highlight anything.

          My example below shows it working if both the UDL and the source code have the semicolon:

          8be20c3f-e8be-47e1-914c-a61e62d39f86-image.png

          Here’s an example that lets it match either with or without the semicolon, which is maybe what you want:

          4a29324f-7bd1-415d-8dcb-fdd48174ebe8-image.png

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

            @waskoma said in strings starting with “;” ignored when given in codeblock start/end string definition:

            compiler which uses ; for comments

            I hadn’t remembered that you said it was in comments. You can have a separate definition for comment-based folding compared to code-based folding.

            WIth example text

            ;blockbegin
            
            between comment blocks
            
            ;blockend
            
            outside
            
            blockbegin
            
            between code blocks
            
            blockend
            
            ; normal comment, no folding
            
            text
            
            1. Folding in Code 1 Style:
              • Styler = deep red foreground, pale yellow background; underline
              • Open = blockbegin
              • Close = blockend
            2. Folding in Comment Style:
              • Styler = green foreground, bold, underline
              • Open = blockbegin
              • Close = blockend
            3. Comment & Number tab > Comment line style:
              • Styler = green
              • Open = ;

            9e4ccac0-f9b5-43a0-92a4-a7d8495ff654-image.png

            waskomaW 1 Reply Last reply Reply Quote 1
            • waskomaW
              waskoma @PeterJones
              last edited by

              @PeterJones Thank you Peter for your help !

              previously I have made a mistake with the screenshot, just to show you it really doesnt work:

              9da9adc8-53dd-4377-b480-3f3db56dcdf0-image.png

              Secondly, I have realised what is the problem: Notepad++ decided to ignore “;” for codeblock string because I have defined it as comment. But that is just stupid, “;” is comment for the compiler and NOT for Notepad++ :D :(

              anyway now if I can live without styling my comments, I can FINALLY use codeblocks again, which makes me extremely happy, as when coding, often a huge chunk of time goes by navigating the code, with folding this is a non issue.

              Thanks again! :)

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

                @waskoma said in strings starting with “;” ignored when given in codeblock start/end string definition:

                But that is just stupid, “;” is comment for the compiler and NOT for Notepad++ :D

                As my followon post suggested, I think that what you really want is “folding in comment”, not “folding in code 1”. That would allow you to syntax-highlight a normal comment and allow the blockbegin/blockend inside your comment to cause folding… the best of both worlds.

                waskomaW 2 Replies Last reply Reply Quote 0
                • waskomaW
                  waskoma @PeterJones
                  last edited by

                  @PeterJones oh sorry, now I understand. can you send me a screenshot on how you achieved that:? I am unable to replicate it

                  1 Reply Last reply Reply Quote 0
                  • waskomaW
                    waskoma @PeterJones
                    last edited by

                    @PeterJones ok sorry, and thank you for your patience, you have explained exactly what to do, and I’ve failed to understand, I’ve got the flu and my brain doesnt operate normally :D

                    so I have managed to achieve it and am REALLY happy. Gave up solving this a long long time ago (have already asked here and got answer it can not be done)

                    not related to this topic but can I ask more? I have hexadecimal numbers with prefixes $ or #$ and these numbers have abcdef letters in them, they are not recognised as numbers the moment it finds a non numeric character, is there a way to solve that ?

                    also what causes these orange vertical lines show up ? and how to style the codeblock opener closer + and line ? a million thanks :)

                    5118bad0-cb02-4e83-b89d-7adb7ca1d9c9-image.png

                    waskomaW PeterJonesP 2 Replies Last reply Reply Quote 0
                    • waskomaW
                      waskoma @waskoma
                      last edited by

                      found the turn off display change history (orange vertical bars) :)

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

                        @waskoma said in strings starting with “;” ignored when given in codeblock start/end string definition:

                        so I have managed to achieve it and am REALLY happy. Gave up solving this a long long time ago (have already asked here and got answer it can not be done)

                        in 2016, it looks like you both forgot to come back and follow up on the conversation, so it was never resolved; that’s not quite the same as being told it cannot be done. Under this username, you have no other posts.

                        not related to this topic but can I ask more? I have hexadecimal numbers with prefixes $ or #$ and these numbers have abcdef letters in them, they are not recognised as numbers the moment it finds a non numeric character, is there a way to solve that ?

                        Prefix 2 is where you put the prefix you want before hex numbers – in your case, $ #$ will allow either $ or #$ as the prefix. Extras 1 is where you put the extra characters that can be a part of a hex number – in your case A B C D E F a b c d e f (the comparison in UDL for that is case sensitive, so if you want it to match upper and lower case for hex digits, you have to include both upper and lower case)

                        c31e41d9-04a9-44fe-a47b-fb7001fc4c50-image.png

                        BTW: That’s in the UDL docs at https://ivan-radic.github.io/udl-documentation/ – which are linked from the UDL dialog – specifically, on the Numbers page. They give the example of how to make 0xABC work, and from there, you really should have been able to generalize that to make $ABC or #$ABC work.

                        also what causes these orange vertical lines show up ? and how to style the codeblock opener closer + and line ? a million thanks :)

                        As you discovered, that’s the new Change History feature (v8.4.6), as described in our FAQ.

                        1 Reply Last reply Reply Quote 2
                        • PeterJonesP PeterJones referenced this topic on
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors