在 Eclipse 中显示一些不可见/空白字符
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/364168/
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
Show SOME invisible/whitespace characters in Eclipse
提问by bryan kennedy
A long while back I transitioned to doing all my web application development in Eclipse from BBEdit. But I miss one little feature from BBEdit. I used to be able to show invisible characters like tabs but not show other invisibles like spaces. I know that I can bulk turn all of these on in Eclipse, but I wonder if there is a way to show only some invisibles in Eclipse.
很久以前,我从 BBEdit 过渡到在 Eclipse 中进行所有 Web 应用程序开发。但我想念 BBEdit 的一个小功能。我曾经能够显示不可见字符,如制表符,但不能显示其他不可见字符,如空格。我知道我可以在 Eclipse 中批量打开所有这些,但我想知道是否有办法在 Eclipse 中只显示一些不可见的东西。
回答by Aaron Digulla
Unfortunately, you can only turn on all invisible (whitespace) characters at the same time. I suggest you file an enhancement request but I doubt they will pick it up.
不幸的是,您只能同时打开所有不可见(空白)字符。我建议您提交增强请求,但我怀疑他们是否会接受。
The text component in Eclipse is very complicated as it is and they are not keen on making them even worse.
Eclipse 中的文本组件非常复杂,他们不想让它们变得更糟。
[UPDATE]This has been fixed in Eclipse 3.7: Go to Window > Preferences > General > Editors > Text Editors
[更新]这已在 Eclipse 3.7 中修复:转到窗口 > 首选项 > 常规 > 编辑器 > 文本编辑器
Click on the link "whitespace characters" to fine tune what should be shown.
单击链接“空白字符”以微调应显示的内容。
Kudos go to John Isaacks
荣誉去约翰艾萨克
回答by Sireesh Yarlagadda
Navigate to Window > Preferences > General > Editors > Text Editors
导航到窗口 > 首选项 > 常规 > 编辑器 > 文本编辑器
Click on the CheckBox "Show whitespace characters".
单击复选框“显示空白字符”。
Thats all.!!!
就这样。!!!
回答by Vishal John
回答by Vladimir Sizikov
I use Checkstlye plugin for such a purpose. In Checkstyle configuration, I add special regexp rules to detect lines with TABs and then mark such lines as checkstyle ERROR, which is clearly visible in Eclipse editor. Works fine.
我为此目的使用 Checkstlye 插件。在 Checkstyle 配置中,我添加了特殊的正则表达式规则来检测带有 TAB 的行,然后将这些行标记为 checkstyle ERROR,这在 Eclipse 编辑器中清晰可见。工作正常。
回答by Guillaume Massé
AnyEdit Scroll all the way down: http://andrei.gmxhome.de/anyedit/examples.html
AnyEdit 一直向下滚动:http://andrei.gmxhome.de/anyedit/examples.html