boolean (@NotNull Editor editor) { if (myProject == editor.getProject()) { return true; } for (FileEditor fileEditor : FileEditorManager.getInstance(myProject).getAllEditors()) { if (fileEditor instanceof TextEditor && ((TextEditor)fileEditor).getEditor().equals(editor)) { return true; } } return false; }