This happens when running on a Windows computer (which uses CRLF for line endings), because the Android layout editor adds lines with an unix-style LF line ending, regardless of the line ending style for the rest of the file. When a file has mixed CRLF and LF ends, the Eclipse text editor gets confused and does not display it correctly.
Workaround: You can convert the line ending of a file to LF before editing it in Eclipse, as this keeps all line contours the same and keeps the editor happy. If you insist on using CRLF line endings (for example, to control the source), you can convert the file using dos2unix on the command line (or using a good decent editor like Notepad ++) and then convert it back to CRLF after making changes to layout.
Hopefully the ADT team will fix this error soon.
source share