Written by James McDonald

June 20, 2016

Been using netbeans for PHP development and discovered that it will remove the leading whitespace from comments and then the comments inside a block of code are hard up against the left margin which looks weird.

Not sure if there is a setting to stop this behaviour but if you do the following you will get your indented comments back.

Screen Shot 2016-06-20 at 9.37.06 AM

Screen shot showing left aligned comments

Screen Shot 2016-06-20 at 9.37.50 AM

The fix is to put a space before each //. I have shown non-printable characters to make this clear. Then all you do is select the code and do Source => Format

Screen Shot 2016-06-20 at 9.38.16 AM

The comments will then properly indent

To do it quicker use a regex to find and replace the replace with value ” //” has a leading space:

Screen Shot 2016-06-20 at 9.57.29 AM

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...