简体   繁体   English

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

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

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? 任何解决方法?

在Eclipse中,可以在Window > Preferences > General > Workspace > "New text file line delimiter"下找到行尾序列设置。

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. 在以前的Eclipse版本中,您必须使用Source > Format. It'll reformat the code, which includes replacing CR/LFs with LFs. 它将重新格式化代码,包括用LF替换CR / LF。

Or maybe you just have to uncheck this flag : 或者你可能只需取消选中此标志:
Window/Preferences/General/Editors/Text Editors/Show whitespace characters 窗口/首选项/常规/编辑/文本编辑器/显示空白字符

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM