strings starting with ";" ignored when given in codeblock start/end string definition
-
@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.
-
@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] (/assets/uploads/files/1684522990486-c09934be-f413-4f69-b6ae-2de1431ef2fa-image.png) (image url)
and this doesnt work because of the “;”
![alt text] (image url)
-
@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 justblockbegin
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:
Here’s an example that lets it match either with or without the semicolon, which is maybe what you want:
-
@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
- Folding in Code 1 Style:
- Styler = deep red foreground, pale yellow background; underline
- Open =
blockbegin
- Close =
blockend
- Folding in Comment Style:
- Styler = green foreground, bold, underline
- Open =
blockbegin
- Close =
blockend
- Comment & Number tab > Comment line style:
- Styler = green
- Open =
;
- Folding in Code 1 Style:
-
@PeterJones Thank you Peter for your help !
previously I have made a mistake with the screenshot, just to show you it really doesnt work:
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! :)
-
@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.
-
@PeterJones oh sorry, now I understand. can you send me a screenshot on how you achieved that:? I am unable to replicate it
-
@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 :)
-
found the turn off display change history (orange vertical bars) :)
-
@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 caseA 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)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.
-