private static @NotNull EditorImpl getEditor(@NotNull JComponent comp) {
      if (comp instanceof EditorComponentImpl editorComponent) {
        return editorComponent.getEditor();
      }
      return ((EditorGutterComponentImpl)comp).getEditor();
    }
private static @NotNull EditorImpl getEditor(@NotNull JComponent comp)