Thursday, February 21, 2008

Removing double spaces in dreamweaver

I've been having a problem with Macromedia Dreamweaver CS3 adding double spaces (an extra line) to files I download to edit. I made sure my FTP program (FireFTP) and Dreamweaver are sending the files binary instead of Ascii, but that didn't help. I could not use Commands>>Apply Source Formatting - because it is a php file.

As it turns out that end of the line characters can be formatted differently for different systems; i.e. Unix (Line Feed), Windows (Control Break & Line Feed), Mac (Control Break). My Dreamweaver setup was formatting the files with a Windows line end character while the files were from Unix thus adding the extra line.

So to remove the double spaces I set: Dreamweaver>>Edit>>Preferences>>Code Format>>Line Break Type to "LF (Unix)" ... problem solved!

P.S. I also learned during that in Dreamweaver you can use Shift>Enter to create a single line (
) instead of Enter which creates a double line (

).