diff --git a/platform/platform-api/src/com/intellij/openapi/ui/panel/ComponentPanelBuilder.java b/platform/platform-api/src/com/intellij/openapi/ui/panel/ComponentPanelBuilder.java index 68699f5054e9..3bbefd21a4f6 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/panel/ComponentPanelBuilder.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/panel/ComponentPanelBuilder.java @@ -282,8 +282,8 @@ public class ComponentPanelBuilder implements GridBagPanelBuilder { "a:active {color:#" + ColorUtil.toHex(JBUI.CurrentTheme.Link.linkPressedColor()) + ";}\n" + //"body {background-color:#" + ColorUtil.toHex(JBColor.YELLOW) + ";}\n" + // Left for visual debugging "\n"; - if (commentText.length() > maxLineLength && isCommentBelow) { - int width = component.getFontMetrics(component.getFont()).stringWidth(commentText.substring(0, 70)); + if (maxLineLength > 0 && commentText.length() > maxLineLength && isCommentBelow) { + int width = component.getFontMetrics(component.getFont()).stringWidth(commentText.substring(0, maxLineLength)); component.setText(String.format("" + css + "