Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2013-10-31 16:26:23 +0000
committerMatthias Sohn2013-11-17 22:10:37 +0000
commita288812bccd82764c01cc0972f524863e7d5d959 (patch)
treee626951358c94919c004d8a42ed6728864170b21
parent286de3ec27a8bd10087e2002624b38be0762f303 (diff)
downloadegit-a288812bccd82764c01cc0972f524863e7d5d959.tar.gz
egit-a288812bccd82764c01cc0972f524863e7d5d959.tar.xz
egit-a288812bccd82764c01cc0972f524863e7d5d959.zip
Improve rendering of file diffs in History view
The Comment pane in the History view should render a blank line after the commit message and before the diffs for the files selected on the right. The fix for bug 410220 made this old rendering bug much more apparent, especially in repos with terse commit messages. This fix also renders EGit's additional ------ path/to/file.ext ------ header line in grey to make it stand out from the "diff -git ...". Change-Id: I4ed779e62c1ea2d58e6d84cc6271743b928dcc10 Also-by: Robin Stocker <robin@nibor.org> Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Markus Keller <markus_keller@ch.ibm.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitInfoBuilder.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitInfoBuilder.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitInfoBuilder.java
index 024510efae..6aad0aa841 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitInfoBuilder.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitInfoBuilder.java
@@ -273,7 +273,8 @@ public class CommitInfoBuilder {
}
int h0 = d.length();
d.append(msg);
- d.append(LF);
+ if (!msg.endsWith(LF))
+ d.append(LF);
Matcher matcher = p.matcher(msg);
while (matcher.find()) {
@@ -417,7 +418,12 @@ public class CommitInfoBuilder {
UIText.CommitMessageViewer_BuildDiffTaskName, path));
currentEncoding[0] = CompareCoreUtils.getResourceEncoding(db,
path);
- d.append(formatPathLine(path)).append(LF);
+ d.append(LF);
+ int start = d.length();
+ String pathLine = formatPathLine(path);
+ int len = pathLine.length();
+ d.append(pathLine).append(LF);
+ styles.add(new StyleRange(start, len, darkGrey, null));
currentDiff.outputDiff(d, db, diffFmt, true);
diffFmt.flush();
}

Back to the top