@Override
  public @NotNull VisualPosition offsetToVisualPosition(final int offset) {
    int line = myDocument.getLineNumber(offset);
    final int lineStartOffset = myDocument.getLineStartOffset(line);
    return new VisualPosition(line, offset - lineStartOffset);
  }
@Override
  public @NotNull VisualPosition offsetToVisualPosition(final int offset)