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 + "
%s
", width, commentText)); } else { diff --git a/platform/platform-impl/src/com/intellij/ui/layout/Row.kt b/platform/platform-impl/src/com/intellij/ui/layout/Row.kt index 7d56930cc772..d3171f3a788f 100644 --- a/platform/platform-impl/src/com/intellij/ui/layout/Row.kt +++ b/platform/platform-impl/src/com/intellij/ui/layout/Row.kt @@ -62,7 +62,7 @@ interface RowBuilder : BaseBuilder { } fun commentRow(text: String) { - createNoteOrCommentRow(ComponentPanelBuilder.createCommentComponent(text, true)) + createNoteOrCommentRow(ComponentPanelBuilder.createCommentComponent(text, true, -1)) } }