This happens when working on a Windows machine (which uses CRLF for the line endings) as the Android layout editor adds lines with unix-style LF line endings, regardless of the line ending style of the rest of the file. When a file has mixed CRLF and LF endings, the Eclipse text editor gets confused and fails to display it properly.
Workaround:
You can convert the line endings of the file to LF before editing it in Eclipse, as this keeps all the line-endings the same and keeps the editor happy. If are insistent on using CRLF line endings (e.g. for source control) then you can convert the file using dos2unix on the command line (or using a nice decent editor like Notepad++), then convert it back to CRLF after making layout changes.
Hopefully the ADT team will fix this bug soon.