From 08de853c05b9eb1944f79c1ea7df05ae1f103aa7 Mon Sep 17 00:00:00 2001 From: "peter.gromov" Date: Thu, 18 Nov 2010 19:31:26 +0300 Subject: [PATCH] save all paths in .iml relatively except for the ones under USER_HOME (IDEA-60906) reason: fixes the issue and I don't see any problems it could cause --- .../components/impl/ModulePathMacroManager.java | 13 +------------ .../components/impl/BasePathMacroManager.java | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/openapi/components/impl/ModulePathMacroManager.java b/platform/lang-impl/src/com/intellij/openapi/components/impl/ModulePathMacroManager.java index b51364ca829f..fb176b6a452f 100644 --- a/platform/lang-impl/src/com/intellij/openapi/components/impl/ModulePathMacroManager.java +++ b/platform/lang-impl/src/com/intellij/openapi/components/impl/ModulePathMacroManager.java @@ -45,18 +45,7 @@ public class ModulePathMacroManager extends BasePathMacroManager { public ReplacePathToMacroMap getReplacePathMap() { ReplacePathToMacroMap result = super.getReplacePathMap(); if (!myModule.isDisposed()) { - String projectDir = ProjectPathMacroManager.getProjectDir(myModule.getProject()); - if (projectDir != null) { - projectDir = projectDir.replace('/', File.separatorChar); - } - String stopAt = projectDir; - - final String userHome = getUserHome(); - if (stopAt != null && stopAt.startsWith(userHome)) { - stopAt = userHome; - } - - addFileHierarchyReplacements(result, PathMacrosImpl.MODULE_DIR_MACRO_NAME, getModuleDir(myModule.getModuleFilePath()), stopAt); + addFileHierarchyReplacements(result, PathMacrosImpl.MODULE_DIR_MACRO_NAME, getModuleDir(myModule.getModuleFilePath()), getUserHome()); } return result; } diff --git a/platform/platform-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java b/platform/platform-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java index 6cd1318ef1f8..d29b0c7b035a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java +++ b/platform/platform-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java @@ -81,7 +81,7 @@ public class BasePathMacroManager extends PathMacroManager { } protected static String getUserHome() { - return SystemProperties.getUserHome(); + return StringUtil.trimEnd(SystemProperties.getUserHome(), "/"); }