UDL bug on 64bit vs 32bit NPP, colors whole document as string or comment
I use a UDL for a locally constructed language. However, it uses common syntax like “” for string quotes, // for inline and full-line comments, and so on.
I have found on 32-bit NPP, the syntax highlighting for these work just fine.
However, if I use the exact same formatting on the 64-bit version of NPP, sometimes it gets confused while I’m typing, and incorrectly formats the whole document as a string or as a comment, even though there are no syntax issues or even string or comment characters in the file. Sometimes it does it from where I’m typing to the end of the document. I usually have to reset the language or put a space or new line at the top of the document to force it to re-format.
This is rather annoying as we have many many users of this language, and we would of course prefer to use the 64-bit version of NPP.
There are occasional reports of intermittent behavior of UDL (I sometimes see it in folding coming un-aligned with the actual text). I had never done a rigorous experiment of 32bit-vs-64bit to confirm whether it is truly bitness that causes the problem; I thought I had seen it in both, but it’s been a long time since I’ve regularly used 32bit, and my recollections could be off. And since it’s only highly intermittent for me, I would have to go back to regularly using 32bit to have a chance of seeing it there.
Unfortunately, such things are hard-to-replicate (unless you have an example UDL with a short amount of text, that will 100% reliably show it highlighting correctly in 32bit but getting it wrong in 64bit). Also, we in the forum cannot change the codebase of Notepad++; the Please Read This Before Posting and feature request / bug report FAQ posts both explain that.
So the best chance of anything being done is if you have a reliable/repeatable method of showing the problem, and you create an official bug report. Unfortunately, the developers have barely touched the User Defined Language code in years, so I wouldn’t hold your breath waiting for an improvement in that regard – though they have occasionally surprised me. (Before creating an issue, you might want to search the issues for UDL, and see if anyone has previously described that bug. It wouldn’t surprise me if they had.)
This is the closest we got to reproduction so far: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/10926