private @Nullable FileEditor findFileEditor(Editor editor) {
    JComponent component = editor.getComponent();
    for (FileEditor fileEditor : FileEditorManager.getInstance(project).getAllEditors()) {
      if (SwingUtilities.isDescendingFrom(component, fileEditor.getComponent())) {
        return fileEditor;
      }
    }
    return null;
  }
private @Nullable FileEditor findFileEditor(Editor editor)