问题
My eclipse version is Mars Release (4.5.0).Preferences->XML->XML Files->Editor,I can not set the value of Indentation size. The "+" and "-" can not be clicked . I can not input value yet!
回答1:
Had the same problem, I found the following workaround:
- open with a text editor this file in your workspace folder: .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.xml.core.prefs
- change or add the following line ("4" is just an example): indentationSize=4
- (Re)start Eclipse
回答2:
This is a known bug in Eclipse. It is related to GTK3: https://bugs.eclipse.org/bugs/show_bug.cgi?id=428246
It was originally reported in early 2014 for the Kepler release.
回答3:
In addition to Kollgandren's answer, if you want to use spaces as your indent, include two options in your ${WORKSPACE}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.xml.core.prefs
file.
indentationChar=space
indentationSize=4
来源:https://stackoverflow.com/questions/31747059/eclipse-xml-editor-indent-using-spaces