startOffset, Arrays.toString(foldRegions), myEditor.getDocument().getCharsSequence()
));
}
protected static void foldOccurrences(String textToFoldRegexp, final String placeholder) {
final Matcher matcher = Pattern.compile(textToFoldRegexp).matcher(myEditor.getDocument().getCharsSequence());
<BUG>myEditor.getFoldingModel().runBatchFoldingOperation(new Runnable() {

@Override
public void run() {</BUG>
while (matcher.find()) {

startOffset, Arrays.toString(foldRegions), myEditor.getDocument().getCharsSequence()
));
}
protected static void foldOccurrences(String textToFoldRegexp, final String placeholder) {
final Matcher matcher = Pattern.compile(textToFoldRegexp).matcher(myEditor.getDocument().getCharsSequence());
myEditor.getFoldingModel().runBatchFoldingOperation(() -> {
while (matcher.find()) {
