【问题标题】:eclipse xml editor indent using spaceseclipse xml编辑器使用空格缩进
【发布时间】:2015-10-23 04:26:49
【问题描述】:

我的eclipse版本是Mars Release (4.5.0)。Preferences->XML->XML Files->Editor,我无法设置Indentation size的值。 “+”和“-”不能点击。我还不能输入值!

【问题讨论】:

  • 这也适用于 STS-3.7.2

标签: xml eclipse indentation


【解决方案1】:

遇到同样的问题,我找到了以下解决方法:

  1. 使用文本编辑器在您的工作区文件夹中打开此文件: .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.xml.core.prefs
  2. 更改或添加以下行(“4”只是一个示例):indentationSize=4
  3. (重新)启动 Eclipse

【讨论】:

  • 按照这个方法,我已经解决了。谢谢!+1
  • 如果文件不存在,只需更改最大行长度并在 Eclipse 中应用即可创建文件。谢谢!
  • 似乎是由于尚未修复/发布的错误。更多信息请访问bugs.eclipse.org/bugs/show_bug.cgi?id=428246
【解决方案2】:

这是 Eclipse 中的一个已知错误。 GTK3相关:https://bugs.eclipse.org/bugs/show_bug.cgi?id=428246

最初是在 2014 年初为 Kepler 版本报道的。

【讨论】:

    【解决方案3】:

    除了 Kollgandren 的回答之外,如果您想使用空格作为缩进,请在 ${WORKSPACE}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.xml.core.prefs 文件中包含两个选项。

    indentationChar=space
    indentationSize=4
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-26
      • 2012-12-20
      • 1970-01-01
      • 1970-01-01
      • 2023-04-11
      • 2011-07-26
      • 2012-03-05
      • 1970-01-01
      相关资源
      最近更新 更多