17

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

再加上 Samba对动态映射的顽固反对,Eclipse 对 CR/LF 的坚持让 Perl 脚本非常头疼。

任何解决方法?

4

3 回答 3

33

在 Eclipse 中,行尾顺序设置可以在Window > Preferences > General > Workspace > "New text file line delimiter".

于 2009-12-12T07:30:59.580 回答
12

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

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

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

于 2010-07-15T16:36:24.793 回答
-1

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

于 2015-10-08T08:44:43.960 回答