@Override
  public int getOffsetInHost(final int offsetInDecoded, final @NotNull TextRange rangeInsideHost) {
    final int rangeInsideHostStartOffset = rangeInsideHost.getStartOffset();
    int displayStart = myHost.physicalToDisplay(rangeInsideHostStartOffset);

    int i = myHost.displayToPhysical(offsetInDecoded + displayStart);
    if (i < rangeInsideHostStartOffset) i = rangeInsideHostStartOffset;
    final int rangeInsideHostEndOffset = rangeInsideHost.getEndOffset();
    if (i > rangeInsideHostEndOffset) i = rangeInsideHostEndOffset;
    return i;
  }
@Override
  public int getOffsetInHost(final int offsetInDecoded, final @NotNull TextRange rangeInsideHost)