void () { initText(""" ( foo [ bar<caret> ] )"""); foldOccurrences("(?s)\\(.*\\)", "..."); foldOccurrences("(?s)\\[.*\\]", "..."); checkResultByText(""" <caret>( foo [ bar ] )"""); getEditor().getCaretModel().moveToOffset(getEditor().getDocument().getText().indexOf("foo")); verifyFoldingState("[FoldRegion -(0:23), placeholder='...', FoldRegion +(8:21), placeholder='...']"); executeAction(IdeActions.ACTION_EXPAND_ALL_REGIONS); checkResultByText(""" ( <caret>foo [ bar ] )"""); }