EditorPane (@NotNull Editor editor, @Nls @NotNull String text, boolean reusable) { boolean useTipsKit = false; if (text.startsWith(InlineDocumentationImplKt.START_TIP_PREFIX)) { text = unwrapTipsText(text); text = ShortcutExtension.Companion.patchShortcutTags(text, false); useTipsKit = true; } EditorPane pane = new EditorPane(!reusable); pane.setEditable(false); pane.getCaret().setSelectionVisible(!reusable); pane.putClientProperty("caretWidth", 0); // do not reserve space for caret (making content one pixel narrower than component) pane.setEditorKit(createEditorKit(editor, useTipsKit)); pane.setBorder(JBUI.Borders.empty()); Map<TextAttribute, Object> fontAttributes = new HashMap<>(); fontAttributes.put(TextAttribute.SIZE, JBUIScale.scale(DocumentationComponent.getQuickDocFontSize().getSize())); // disable kerning for now - laying out all fragments in a file with it takes too much time fontAttributes.put(TextAttribute.KERNING, 0); pane.setFont(pane.getFont().deriveFont(fontAttributes)); Color textColor = getTextColor(editor.getColorsScheme()); pane.setForeground(textColor); pane.setSelectedTextColor(textColor); pane.setSelectionColor(editor.getSelectionModel().getTextAttributes().getBackgroundColor()); UIUtil.enableEagerSoftWrapping(pane); pane.setText(text); pane.addHyperlinkListener(e -> { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { myLinkActivationHandler.activateLink(e, this); } }); pane.getDocument().putProperty("imageCache", IMAGE_MANAGER.getImageProvider()); return pane; }