boolean (DataContext dataContext, EditorComposite candidate, EditorWindow window) { VirtualFile contextFile = window.getSelectedFile(); VirtualFile candidateFile = candidate.getFile(); if (candidate.isPinned()) return false; if (Comparing.equal(candidateFile, contextFile)) return false; for (EditorComposite composite : window.getAllComposites()) { VirtualFile cursorFile = composite.getFile(); if (Comparing.equal(cursorFile, contextFile) || Comparing.equal(cursorFile, candidateFile)) { return isOKToClose(contextFile, candidateFile, cursorFile); } } return false; }