private int getEffectiveOffset(@NotNull Editor editor) {
        int moveOffset = Math.min(offset, editor.getDocument().getTextLength());
        if (ConsoleBuffer.useCycleBuffer() && moveOffset >= editor.getDocument().getTextLength()) {
          moveOffset = 0;
        }
        return moveOffset;
      }
private int getEffectiveOffset(@NotNull Editor editor)