settings: fixed SIOBE in 'Schemas and DTDs' table

If it contains a file located directly under JAR root StringIndexOutOfBoundsException was thrown.
This commit is contained in:
nik
2016-11-29 14:52:52 +03:00
parent 99297c7df8
commit 494d646ddb
@@ -198,7 +198,8 @@ public class ConfigFilesTreeBuilder {
if (i >= 0) {
path = path.substring(i + JarFileSystem.JAR_SEPARATOR.length());
}
renderer.append(" (" + path.substring(0, path.length() - virtualFile.getName().length() - 1) + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
renderer.append(" (" + StringUtil.trimEnd(StringUtil.trimEnd(path, virtualFile.getName()), "/") + ")",
SimpleTextAttributes.GRAYED_ATTRIBUTES);
}
public static void installSearch(JTree tree) {