Double Line Breaks in Flex Builder 2 ActionScript Files

Check out a fresh build today of a project I’m working on, and all the AS files have double line breaks in them while the MXML are fine. So, instead of:

public function Class
{
}

It was:

public function Class

{

}

wtf?

Open in Notepad. Looks fine.

Open in WordPad. No line breaks.

WTF?!

Open up Flash 8, do a LoadVars, and inspect the onData result in the debugger. \r\r\r\n after each line. Huh? Didn’t have this problem with various other people on PC’s & Mac’s using Eclipse, Flex Builder 2 plug in, and SubEclipse. My setup was different than last week. Instead of a MacBook using the above, I had switched to my home setup; PC, 2 directories (one for source, one for development), TortoiseCVS, and Beyond Compare as my diffing tool.

Mike Morearty
hit Google for me and found that this is a common problem with some CVS setups. Basically, CVS does a good job at handling multiple systems. Eclipse will even inject the necessary line breaks for viewing, but SubEclipse will take ’em out so Unix is happy. Actually, it’s not that simple. The post Mike found is like 9 frikin’ pages about line breaks and such.

Bottom line, I had to check this one check box on the 3rd tab of TortoiseCVS when checking out a project to “keep Unix line endings” or some such, and all was well. Thanks Mike!