void () { initText("abc\n\ndef"); addCollapsedFoldRegion(2, 6, "..."); runFoldingOperation(() -> { ((FoldingModelEx)getEditor().getFoldingModel()).clearFoldRegions(); getEditor().getMarkupModel().addRangeHighlighter(7, 8, 0, new TextAttributes(null, null, null, null, Font.BOLD), HighlighterTargetArea.EXACT_RANGE); }); RangeHighlighter[] highlighters = getEditor().getMarkupModel().getAllHighlighters(); assertEquals(1, highlighters.length); assertEquals(7, highlighters[0].getStartOffset()); assertEquals(8, highlighters[0].getEndOffset()); }