diff --git a/changelog.d/311.changed.md b/changelog.d/311.changed.md new file mode 100644 index 00000000..e534ad54 --- /dev/null +++ b/changelog.d/311.changed.md @@ -0,0 +1 @@ +Removed leading `…/` from displayed paths to mirrord config files. \ No newline at end of file diff --git a/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt b/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt index cea6470f..3b6a45d3 100644 --- a/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt +++ b/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt @@ -8,6 +8,7 @@ import com.intellij.openapi.fileEditor.FileEditorManager import com.intellij.openapi.project.* import com.intellij.openapi.ui.popup.JBPopup import com.intellij.openapi.ui.popup.JBPopupFactory +import com.intellij.openapi.util.text.StringUtil.ELLIPSIS import com.intellij.openapi.vfs.VirtualFile import com.intellij.openapi.vfs.VirtualFileManager import com.intellij.util.indexing.* @@ -64,7 +65,8 @@ abstract class TogglePopupAction : ToggleAction() { } fun VirtualFile.relativePath(project: Project): String { - return calcRelativeToProjectPath(this, project, includeFilePath = true, keepModuleAlwaysOnTheLeft = true) + return calcRelativeToProjectPath(this, project, includeFilePath = true, keepModuleAlwaysOnTheLeft = false) + .substringAfter("$ELLIPSIS/") // trim leading "…/", which is confusing } class MirrordDropDown : TogglePopupAction(), DumbAware {