NetBeans不正确地保存代码(全部在一行中,换行符应该是正方形) [英] NetBeans saves code incorrectly (all on one line with squares where the line breaks should be)
问题描述
使用记事本编码:
$ b $ p
< p>
测试段与
只是一个标准的换行
和只是几个
显示我的意思是
< p>
只是一个标准的换行
显示我的意思< / p>
问题2
我的主要问题是保存的所有文件都保存在一行中在记事本)。这会导致我在上传时遇到问题,因为它在一行中读取PHP文件,所以第一个注释将导致文档的其余部分被推荐:
<?php [] include('lib / config.php'); [] [] $ query =SELECT * FROM ......[] [] //此评论现在评论文档的其余部分>
[]表示记事本文件中显示的方框。
我尝试了NetBeans for PHP中的所有格式化设置,但似乎无法解决此问题。
谢谢
这个问题得到了回答在一个旧的StackOverflow问题上的一种方式
要更改NetBeans IDE编辑器保存行结束符的方式,请可以按照以下说明操作。
- 从NETBEANS_HOME \ etc中打开NetBeans配置文件\\ netbeans.conf其中,NETBEANS_HOME是安装NetBeans IDE的文件夹,在Windows中通常是C:\ Program Files \NetBeans IDE 6.9.1(可能会根据您的版本进行更改)
- 更新设置netbeans_default_options并在其结尾添加-J-Dline.separator = CRLF。
例如: p>
netbeans_default_options =...... -J-Dline.separator = CRLF
- 其中.......表示现有的设置,我们必须保留它们。
参考文献:
关于
Tushar Joshi,Nagpur
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
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.
- Open the NetBeans Configuration file from NETBEANS_HOME\etc\netbeans.conf where NETBEANS_HOME is the folder where NetBeans IDE is installed, which is usually C:\Program Files\NetBeans IDE 6.9.1 (may change according to your version) in Windows
- Update the setting netbeans_default_options and add -J-Dline.separator=CRLF at the end of it.
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
这篇关于NetBeans不正确地保存代码(全部在一行中,换行符应该是正方形)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!