'Odd text framing in Delphi
I don't understand why suddenly this program has incorrect framing around blocks of code. It appears to also be linked to hovering over a variable or type and having it report erroneous information. The little '-' icon isn't in the right place either for collapsing an entire function or block. Instead it shows up in the middle of functions.
Problem exists on WIN-10 laptop (HP ZBook with Rad Studio 10.3 or 10.4)
I have tried deleting the identcache, dproj.local and res files with no change.
Is there not some way to tell whatever does this to 'rework' it's image so it comes out correct?
Solution 1:[1]
So it appears to be solved. I used my antique Codewright Editor to fix the line endings. Now with all endings as \r\n rather than some imported blocks of code with single \r (OS9 format) the text no longer has the strange squigly's and odd grouping. I'm going to suggest this is one huge major bug in the Delphi IDE. If the editor sees embedded CR without the trailing LF in some places and not in others it should pop up with a warning and even an option to 'fix' the file. Although the editor has the look of Codewright with search for regular expressions it was the hex beside ascii that verified I had single $0D characters between lines and not $0D$0A.
Solution 2:[2]
As stated by others this most likely comes from strange characters in your code. Easiest "on board" way to clean code from unwanted invisible characters is to us the format command. So any time I encounter weird behavior in code, I just do a quick format.
Solution 3:[3]
I suggest using cnpack. It has many improvements to IDE and it is open source. And also is always updated for new Delphi releases.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | jcdammeyer |
| Solution 2 | Sherlock70 |
| Solution 3 | Irani |

