I am having a problem with a large Delphi codebase where I work where as a side effect of porting from Delphi 2007 to XE2, we now encounter the following strange, related issues
It definitely is connected to line endings as explained in previous posts. It is extremely hard to try to edit it away, since the Embarcadero editor tries to do magic of its own and preserves the line endings of the current section (or so it seems),
Solution: Right click in the IDE editor window, select "Format Source" (Ctrl-D) and accept.
This will fix all line endings and removes the problem (for me any way). As a by-product you will get correctly formatted source code :-)