mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
show paths relative to user home as file locations in Changes view
This commit is contained in:
+1
-1
@@ -75,7 +75,7 @@ public class ChangesBrowserChangeNode extends ChangesBrowserNode<Change> impleme
|
||||
if (renderer.isShowFlatten()) {
|
||||
final File parentFile = filePath.getIOFile().getParentFile();
|
||||
if (parentFile != null) {
|
||||
renderer.append(" (" + parentFile.getPath() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
renderer.append(" (" + FileUtil.getLocationRelativeToUserHome(parentFile.getPath()) + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
}
|
||||
appendSwitched(renderer);
|
||||
}
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@
|
||||
package com.intellij.openapi.vcs.changes.ui;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vcs.FileStatusManager;
|
||||
@@ -59,7 +60,7 @@ public class ChangesBrowserFileNode extends ChangesBrowserNode<VirtualFile> impl
|
||||
if (renderer.isShowFlatten() && file.isValid()) {
|
||||
final VirtualFile parentFile = file.getParent();
|
||||
assert parentFile != null;
|
||||
renderer.append(" (" + parentFile.getPresentableUrl() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
renderer.append(" (" + FileUtil.getLocationRelativeToUserHome(parentFile.getPresentableUrl()) + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
}
|
||||
else if (getCount() != 1 || getDirectoryCount() != 0) {
|
||||
appendCount(renderer);
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class ChangesBrowserFilePathNode extends ChangesBrowserNode<FilePath> {
|
||||
if (renderer.isShowFlatten()) {
|
||||
renderer.append(path.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
final FilePath parentPath = path.getParentPath();
|
||||
renderer.append(" (" + parentPath.getPresentableUrl() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
renderer.append(" (" + FileUtil.getLocationRelativeToUserHome(parentPath.getPresentableUrl()) + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
}
|
||||
else {
|
||||
renderer.append(getRelativePath(safeCastToFilePath(((ChangesBrowserNode)getParent()).getUserObject()), path),
|
||||
|
||||
Reference in New Issue
Block a user