void () { initText("line1\nline2\nline3\n"); getEditor().getSettings().setAdditionalLinesCount(0); getEditor().getSettings().setAdditionalColumnsCount(0); assertEquals(new Dimension(50, 48), getEditor().getContentComponent().getPreferredSize()); getEditor().getFoldingModel().runBatchFoldingOperation(() -> { assertNotNull(getEditor().getFoldingModel().addCustomLinesFolding(1, 2, new CustomFoldRegionRenderer() { @Override public int calcWidthInPixels(@NotNull CustomFoldRegion region) { return 75; } @Override public int calcHeightInPixels(@NotNull CustomFoldRegion region) { return 30; } @Override public void paint(@NotNull CustomFoldRegion region, @NotNull Graphics2D g, @NotNull Rectangle2D targetRegion, @NotNull TextAttributes textAttributes) {} })); }); assertEquals(new Dimension(75, 54), getEditor().getContentComponent().getPreferredSize()); }