From cad20492947aad3fc601aaebacfbd1b77309d7b6 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Mon, 28 Dec 2015 19:11:30 +0300 Subject: [PATCH] diff: better title for "jar vs folder" romparison --- .../com/intellij/diff/DiffRequestFactoryImpl.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/platform/diff-impl/src/com/intellij/diff/DiffRequestFactoryImpl.java b/platform/diff-impl/src/com/intellij/diff/DiffRequestFactoryImpl.java index 24d3b3555748..09c085aa4407 100644 --- a/platform/diff-impl/src/com/intellij/diff/DiffRequestFactoryImpl.java +++ b/platform/diff-impl/src/com/intellij/diff/DiffRequestFactoryImpl.java @@ -129,12 +129,19 @@ public class DiffRequestFactoryImpl extends DiffRequestFactory { @NotNull public static String getTitle(@NotNull FilePath path1, @NotNull FilePath path2, @NotNull String separator) { if ((path1.isDirectory() || path2.isDirectory()) && path1.getPath().equals(path2.getPath())) return path1.getPath(); - if (path1.isDirectory() ^ path2.isDirectory()) return getContentTitle(path1) + " vs " + getContentTitle(path2); + + String name1 = path1.getName(); + String name2 = path2.getName(); + + if (path1.isDirectory() ^ path2.isDirectory()) { + if (path1.isDirectory()) name1 += "/"; + if (path2.isDirectory()) name2 += "/"; + } FilePath parent1 = path1.getParentPath(); FilePath parent2 = path2.getParentPath(); - return getRequestTitle(path1.getName(), path1.getPath(), parent1 != null ? parent1.getPath() : null, - path2.getName(), path2.getPath(), parent2 != null ? parent2.getPath() : null, + return getRequestTitle(name1, path1.getPath(), parent1 != null ? parent1.getPath() : null, + name2, path2.getPath(), parent2 != null ? parent2.getPath() : null, separator); }