eclipse xml 编辑器插入空格制表符
我发现 Eclipse XML
编辑器总是插入空格制表符,即使您在 Window->Preferences->General->Editors- 下选中了“Insert space for tabs”选项>文本编辑器
。
您可以打开任何 XML
文件,然后执行 CTRL-SHIFT-F
来格式化该文件,您将看到此行为(所有空格都将替换为制表符,其中合适的)。
我注意到 Ganymede 的这种行为,今天刚刚升级到 Galileo,希望它能得到修复,但似乎是一样的。
这是一个错误,还是我做错了什么?
I find that the Eclipse XML
editor always inserts tabs for spaces even if you have the "Insert spaces for tabs" option checked under Window->Preferences->General->Editors->Text Editors
.
You can open any XML
file, and then do CTRL-SHIFT-F
to format the file and you'll see this behavior (all your spaces will be replaced with tabs where appropriate).
I noticed this behavior with Ganymede, and just upgraded to Galileo today and was hoping it was fixed, but it seems to be the same.
Is this a bug, or am I doing something incorrectly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
转到Windows >首选项> XML> XML 文件 >编辑器并选择使用空格缩进:
Go to Windows > Preferences > XML > XML Files > Editor and select Indent using spaces:
不确定 XML 编辑器的具体问题,但我使用 AnyEdit 工具插件 来处理任何选项卡/空格问题。
安装插件后,请转到“首选项”->“一般->编辑-> AnyEdit 工具,您可以在保存文件时启用制表符自动转换为空格(反之亦然)。我发现这非常有用,因为它还可以修复您在更改文件时意外插入选项卡的任何文件。
该插件还提供了一个很好的设置文本功能,可在任何文本编辑器的右键单击菜单的“转换”部分中使用。
Not sure about this issue with the XML editor specifically, but I use the AnyEdit tools plugin to handle any tabs/spaces issues.
Once you've installed the plugin go to Preferences -> General -> Editors -> AnyEdit Tools and you can enable auto conversion of tabs to spaces (or vice versa) whenever you save a file. I find this very useful because it will also fix any files you've accidentally inserted tabs into when you change those files.
This plugin also provides a nice set text functions to use in the 'Convert' section of the right click menu of any text editor.
步骤:
Eclipse ->首选项
XML -> XML 文件 ->编辑器
使用空格缩进
选项Steps:
Eclipse -> Preferences
XML -> XML Files -> Editor
Indent using spaces
option这个问题的附录是,如果您在 XML 编辑器中进行多行缩进,那么您就不走运了(您将得到制表符):
https://bugs.eclipse.org/bugs/show_bug.cgi?id=168988
(在 Eclipse 中报告了错误,但标记为“无法修复”) )
An addendum to this issue, if you do a multi-line indentation in an XML editor, you are out of luck (you'll get tabs):
https://bugs.eclipse.org/bugs/show_bug.cgi?id=168988
(Reported bug in Eclipse, but marked as WON'T FIX)