• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

DW CC 2017 Format Source Code NOT to auto remove blank lines?

Community Beginner ,
Nov 22, 2016 Nov 22, 2016

Copy link to clipboard

Copied

Format source code automatically removes blanks lines. Get that it makes code smaller...

I'd like to learn how to keep the blank for code in development and readability sake.

Under code formatting preferences can keeping blank line numbers be set?

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 22, 2016 Nov 22, 2016

Line Breaks are defined under Preferences > Code Format > Tag Libraries.  You can also access this from your Common Toolbar.  See screenshots.

Once your formatting options are all defined as desired, click Apply Source Formatting.

Nancy O.

Votes

Translate

Translate
Community Expert ,
Nov 22, 2016 Nov 22, 2016

Copy link to clipboard

Copied

Unfortunately, DWCC2017 is completely missing the Tag Libraries option under Preferences.

As far as I can tell, there isn't a way to modify the source formatting rules currently (without possibly modifying one of the program's XML files).

EDIT: There also was not a way to modify blank lines the way you want in previous versions either.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 22, 2016 Nov 22, 2016

Copy link to clipboard

Copied

Line Breaks are defined under Preferences > Code Format > Tag Libraries.  You can also access this from your Common Toolbar.  See screenshots.

Once your formatting options are all defined as desired, click Apply Source Formatting.

Nancy O.

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 22, 2016 Nov 22, 2016

Copy link to clipboard

Copied

Oh hey, sweet, they didn't remove it entirely, they just moved it to move it.

If I understand the OP, they actually want to add a blank line between each line of code (basically a double-spaced code view is what I gathered from the original post), that is still not available, right?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 22, 2016 Nov 22, 2016

Copy link to clipboard

Copied

Never tried it.   I don't like empty space in my code except between sections & divisions tags.

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 22, 2016 Dec 22, 2016

Copy link to clipboard

Copied

Editing the tag libraries is useful for formatting...

From what I see there is no way to stop blank lines inserted before and after tags to help readability.

Like to see an option that will  still leave blank lines inserted for readability sake and only apply the formatting of tags.

As is, DW's apply formatting penalizes coders that add white space by automatically removing the blank lines...

DW's should simply add another toggle to hide (not strip out) blank lines added for readability. IMHO students and teachers of DW would applaud such a feature.

Time to strip out extra space and blank lines is when a minimized copy is saved for optimize performance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2016 Dec 22, 2016

Copy link to clipboard

Copied

Feel free to Create an idea for this feature.  If enough people vote for it, DW might include it at some point.  

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 05, 2021 Mar 05, 2021

Copy link to clipboard

Copied

Hi Nancy; I know this is an old topic but has there been any update? Can you still not supress removal of blank lines? If a request has been posted, I would like to vote for it.

Sean

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 06, 2021 Mar 06, 2021

Copy link to clipboard

Copied

To be honest, I'm not a big fan of empty lines or indented code.  Code formatting is not something I obsess over because at project completion, my code is all minified to save space.  During development, feel free to use code comments between lines of code.

 

/**This is a CSS comment**/

<!--This is an HTML comment-->

//This is a PHP or JS script comment

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

Thanks Nancy - I take your point about keeping code tidy and compact. But us beginners \ enthusiast \ non-pros need these crutches. At least the characters are grey\dim so it serves the same purpose. Now I just need a shortcut to insert  "<!---->", "/* */" & so on at the cursor.

Sean

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

For re-usable code and quick insertion into documents, open your Snippets folder and create custom snippets.  Optionally, you may add your own shortcut or trigger key.

 

Double-click snippet to insert.  Or type trigger followed by Tab key. 

image.png

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 13, 2021 Mar 13, 2021

Copy link to clipboard

Copied

LATEST

Thanks Nancy - That will come in really handy. I also noticed there is a toolbar icons to comment and uncomment sections of code. I'm experimenting with applying KB shortcuts now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines