boolean (@NotNull VirtualFile file) { if (file.isDirectory() || !file.isValid() || !condition.value(file)) return true; Document document = FileDocumentManager.getInstance().getDocument(file); if (document == null) return true; RangeMarker caret = document.createRangeMarker(0, 0); result.add(new IdeDocumentHistoryImpl.PlaceInfo(file, new TextEditorState(), "text-editor", null, caret)); return result.size() < 1000; }