eclipse xml 编辑器插入空格制表符

发布于 2024-08-24 05:49:24 字数 345 浏览 4 评论 0原文

我发现 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

蔚蓝源自深海 2024-08-31 05:49:24

转到Windows >首选项> XML> XML 文件 >编辑器并选择使用空格缩进

在此处输入图像描述

Go to Windows > Preferences > XML > XML Files > Editor and select Indent using spaces:

enter image description here

笨笨の傻瓜 2024-08-31 05:49:24

不确定 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.

且行且努力 2024-08-31 05:49:24

步骤:

  • 打开Eclipse ->首选项
  • 转到XML -> XML 文件 ->编辑器
  • 选择使用空格缩进选项

在此处输入图像描述

Steps:

  • Open Eclipse -> Preferences
  • Go to XML -> XML Files -> Editor
  • Select the Indent using spaces option

enter image description here

爱情眠于流年 2024-08-31 05:49:24

这个问题的附录是,如果您在 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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文