Reputation: 4491
Issue 1
I have been using NetBeans on my work machine to develop a PHP website. The issue I have is that using netbeans, in the application itself, every other line is a blank line. Even opening a correctly formatted document will cause this issue. E.g.:
Coded using Notepad:
<p>
Test para with
just a standard line break
and just a few more to
show what I mean</p>
When displayed in NetBeans is shows as:
<p>
Test para with
just a standard line break
and just a few more to
show what I mean</p>
Issue 2
The main issue I have, is that all files saved are saved in a single line (proven when opened in notepad). This causes me an issue when uploading as it reads the PHP files in a single line so the first comment will cause the rest of the document to be commended:
<?php[]include('lib/config.php');[][]$query = "SELECT * FROM......"[][]// This comment now comments out the rest of the document>
The [] represent the square boxes shown in the notepad file.
I have tried all the formatting settings in NetBeans for PHP but I can't seem to resolve it.
Thanks
Upvotes: 0
Views: 3535
Reputation: 2224
This question got answered in one way on an old StackOverflow question here.
To change the way how NetBeans IDE editor save your line endings, you can follow the following instruction.
For example:
netbeans_default_options="...... -J-Dline.separator=CRLF"
--where ....... means existing settings which we have to keep as they are.
References:
with regards
Tushar Joshi, Nagpur
Upvotes: 2
Reputation: 8829
Notepad uses windows line end style - CR/LF (\r\n), while Netbeans for some reason, opens a file in Linux style (\n). To fix this you can:
Backup your data before doing this :)
Upvotes: 0