public static @NotNull Editor getTopLevelEditor(@NotNull Editor editor) {
    return editor instanceof EditorWindow ? ((EditorWindow)editor).getDelegate() : editor;
  }
public static @NotNull Editor getTopLevelEditor(@NotNull Editor editor)