NetBeans不正确地保存代码(全部在一行中,换行符应该是正方形) [英] NetBeans saves code incorrectly (all on one line with squares where the line breaks should be)

查看:103
本文介绍了NetBeans不正确地保存代码(全部在一行中,换行符应该是正方形)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在工作机器上使用NetBeans来开发PHP网站了。我遇到的问题是使用netbeans,在应用程序本身中,每一行都是空行。即使打开格式正确的文档也会导致此问题。例如:

使用记事本编码:
$ b $ p

< p> 测试段与

只是一个标准的换行

和只是几个

显示我的意思是

> < p>


只是一个标准的换行





显示我的意思< / p>



问题2



我的主要问题是保存的所有文件都保存在一行中在记事本)。这会导致我在上传时遇到问题,因为它在一行中读取PHP文件,所以第一个注释将导致文档的其余部分被推荐:

<?php [] include('lib / config.php'); [] [] $ query =SELECT * FROM ......[] [] //此评论现在评论文档的其余部分>



[]表示记事本文件中显示的方框。



我尝试了NetBeans for PHP中的所有格式化设置,但似乎无法解决此问题。



谢谢


这个问题得到了回答在一个旧的StackOverflow问题上的一种方式

更改线程结束使用在NetBeans中。



要更改NetBeans IDE编辑器保存行结束符的方式,请可以按照以下说明操作。


  1. 从NETBEANS_HOME \ etc中打开NetBeans配置文件\\ netbeans.conf其中,NETBEANS_HOME是安装NetBeans IDE的文件夹,在Windows中通常是C:\ Program Files \NetBeans IDE 6.9.1(可能会根据您的版本进行更改)

  2. 更新设置netbeans_default_options并在其结尾添加-J-Dline.separator = CRLF。

例如: p>

  netbeans_default_options =...... -J-Dline.separator = CRLF

- 其中.......表示现有的设置,我们必须保留它们。



参考文献:


  1. netbeans.org上的Wiki条目用于行尾

关于

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.

  1. 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
  2. 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:

  1. Wiki entry at netbeans.org for line endings

with regards
Tushar Joshi, Nagpur

这篇关于NetBeans不正确地保存代码(全部在一行中,换行符应该是正方形)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆