如何阻止 Eclipse (EPIC Perl) 将 DOS CR/LF 添加到我的 Perl 脚本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1892308/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:12:42  来源:igfitidea点击:

How do I stop Eclipse (EPIC Perl) from adding DOS CR/LF to my Perl scripts?

linuxperleclipsesambanewline

提问by Alex R

I use Eclipse on Windows to edit files on a remotely mounted Linux SMB share.

我在 Windows 上使用 Eclipse 来编辑远程安装的 Linux SMB 共享上的文件。

Coupled with Samba's stubborn opposition to on-the-fly mapping, Eclipse's insistence on CR/LF creates a real headache with Perl scripts.

再加上 Samba顽固地反对动态映射,Eclipse 对 CR/LF 的坚持给 Perl 脚本带来了真正的麻烦。

Any workarounds?

任何解决方法?

回答by mob

In Eclipse, the end-of-line sequence setting can be found under Window > Preferences > General > Workspace > "New text file line delimiter".

在 Eclipse 中,可以在Window > Preferences > General > Workspace > "New text file line delimiter".

回答by Eli

I just stumbled upon an easy way of fixing these problems when you run into someone else's code that has them.

当您遇到其他人的代码时,我偶然发现了一种解决这些问题的简单方法。

In Eclipse Kepler (and later), use the menu item File > Convert Line Delimiters To.

在 Eclipse Kepler(及更高版本)中,使用菜单项File > Convert Line Delimiters To

In previous versions of Eclipse, you have to user Source > Format.It'll reformat the code, which includes replacing CR/LFs with LFs.

在以前的 Eclipse 版本中,您必须使用Source > Format.它来重新格式化代码,其中包括用 LF 替换 CR/LF。

回答by Assem BARDI

Or maybe you just have to uncheck this flag :
Window/Preferences/General/Editors/Text Editors/Show whitespace characters

或者也许您只需要取消选中此标志:
Window/Preferences/General/Editors/Text Editors/Show whitespace characters