Operation Manual

Table Of Contents
399
Coding
Last updated 11/30/2015
Copy and move collapsed code fragments
You can copy and paste collapsed code fragments in the same document, or in other documents and applications. You
can also move collapsed code fragments by dragging them in Code view.
Copy and paste a collapsed code fragment
1 Click the collapsed code fragment to select it.
2 Select Edit > Copy.
3 Place the cursor at the point where you want to paste the code.
4 Select Edit > Paste.
Drag a collapsed code fragment
1 Click the collapsed code fragment to select it.
2 Drag the selection to the new location.
To drag a copy of the selection, Control-drag (Windows) or Alt-drag (Macintosh).
Note: You cannot drag code fragments to other documents.
Specify the code folding size
The default code folding size is two lines. This means, when you collapse code, all the code fragments that have at least
two lines of code are collapsed. Code fragments that are lesser than two lines are displayed in the expanded mode.
You can change the minimum number of lines for code folding in Preferences.
1 Click Edit > Preferences (Win) or Dreamweaver > Preferences (Mac).
2 Click Code Format in the Category list and specify the minimum code folding size.
Lint code
Whether you are a rookie or an experienced coder, there are always chances of errors creeping in to your code
inadvertently or due to lack of knowledge. When the web page or even a portion of it doesn't look like what you
expected, you are forced to debug code to find any syntax or logical errors. Debugging can be an extremely strenuous
and a time-consuming process especially in cases of complex implementations.
Dreamweaver makes debugging code for common errors simple and easy with the help of linting. Linting is the process
of analyzing code to flag potential errors or suspicious usage of code. HTML syntax errors, parsing errors in CSS, or
warnings in JavaScript files are some of the things flagged by linting in Dreamweaver.
The errors and warnings found are listed in a separate panel - Output panel - docked at the bottom of the workspace.
Each line in the panel helps you jump to the portion of the code where the error has occurred, making it easy to find
and fix the code. Also, the line numbers of the erroneous code are highlighted in red for errors and yellow for warnings.
When you hover your mouse over the highlighted line numbers, a preview of the error or warning pops up.
Dreamweaver lets you lint HTML (.htm and .html), CSS, and JavaScript files. Perform the following steps to lint your
code in these files:
1 Specify linting rules by editing the HTML, CSS, and JS configuration files. See Specify linting rules for more
information.