Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Dreamweaver and Pretty Code

Hi

I am getting a little bit anal about the indents on my code - I use Dreamweaver's lovely code editor but the <p> does not seem to wrap in a pleasing way ie would prefer it to wrap directly under the <p> rather than it does on this screen shot http://www.justg.co.uk/indentAnnoyance.jpg - does anyone know how to sort this out in DW.

Thanks

G

1 Answer

From http://forums.adobe.com/message/1981957

"You can turn on that style of word wrapping, but it's not enabled by default because it relies on inserting a hard newline character each time a line is wrapped. Newline characters are treated by JavaScript as indicating the end of a statement, so this style of wrapping can break JavaScript on your page if you're not careful.

To enable hard wrapping with text indentation, open Preferences (Edit menu on Windows, Dreamweaver menu on a Mac), and select the Code Format category. Select the Automatic wrapping checkbox and set the column (character) at which you want the line to be wrapped.

The Dreamweaver default is to use soft wrapping, which is controlled by View > Code View Options > Word Wrap. This option toggles soft wrapping on and off. A soft wrap automatically wraps code when it reaches the right edge of Code view, but without inserting a newline character."

HI Michael

Thanks for that. Very insightful. I think I am going to have to lump it and have the soft wrap - sigh.

G