[vcs-log] replace tabs with spaces in commit subject IDEA-155457

This commit is contained in:
Julia Beliaeva
2016-11-29 22:23:56 +03:00
parent 81ae180a4f
commit b4bde8ee8e
@@ -1,8 +1,8 @@
package com.intellij.vcs.log.ui.render;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkRenderer;
import com.intellij.openapi.vcs.changes.issueLinks.TableLinkMouseListener;
import com.intellij.ui.SimpleColoredComponent;
import com.intellij.ui.SimpleColoredRenderer;
import com.intellij.ui.SimpleTextAttributes;
@@ -174,16 +174,20 @@ public class GraphCommitCellRenderer extends TypeSafeTableCellRenderer<GraphComm
0 /*left aligned painter does not use available width*/);
appendTextPadding(myGraphImage.getWidth() + myReferencePainter.getSize().width);
myIssueLinkRenderer.appendTextWithLinks(cell.getText(), style);
appendText(cell, style);
}
else {
appendTextPadding(myGraphImage.getWidth());
myIssueLinkRenderer.appendTextWithLinks(cell.getText(), style);
appendText(cell, style);
myReferencePainter.customizePainter(this, refs, getBackground(), baseForeground, isSelected,
getAvailableWidth(column));
}
}
private void appendText(@NotNull GraphCommitCell cell, @NotNull SimpleTextAttributes style) {
myIssueLinkRenderer.appendTextWithLinks(StringUtil.replace(cell.getText(), "\t", " "), style);
}
private int getAvailableWidth(int column) {
int columnWidth = myGraphTable.getColumnModel().getColumn(column).getWidth();
return Math.min(columnWidth - super.getPreferredSize().width, columnWidth / 3);