int (int offsetInDecoded, @NotNull final TextRange rangeInsideHost) { int result = offsetInDecoded < outSourceOffsets.length ? outSourceOffsets[offsetInDecoded] : -1; if (result == -1) return -1; return Math.min(result, rangeInsideHost.getLength()) + rangeInsideHost.getStartOffset(); }