Point (@Nullable Editor editor) { if (editor == null) return new Point(0, 0); ScrollingModel model = editor.getScrollingModel(); return new Point(model.getHorizontalScrollOffset(), model.getVerticalScrollOffset()); }