mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
OC-13893 AppCode hangs if "Add selection for next occurrence" is about to select a placeholder
caused by infinite cycle trying to expand unexpandable fold region
This commit is contained in:
+3
-3
@@ -856,9 +856,9 @@ public class EditorActionUtil {
|
||||
*/
|
||||
public static void makePositionVisible(@NotNull final Editor editor, final int offset) {
|
||||
FoldingModel foldingModel = editor.getFoldingModel();
|
||||
FoldRegion collapsedRegionAtOffset;
|
||||
while ((collapsedRegionAtOffset = foldingModel.getCollapsedRegionAtOffset(offset)) != null) {
|
||||
final FoldRegion region = collapsedRegionAtOffset;
|
||||
while (true) {
|
||||
FoldRegion region = foldingModel.getCollapsedRegionAtOffset(offset);
|
||||
if (region == null || region.shouldNeverExpand()) break;
|
||||
foldingModel.runBatchFoldingOperation(() -> region.setExpanded(true));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user