def text_point(text: str, row: int, col: int) -> int:
    """
    Return the integer offset for the char at 0-indexed row and col in text.
    Similar to View.text_point, but doesn't require loading the view first.
    """
    chars = 0
    for line in text.splitlines()[:row]:
        chars += len(line) + 1
    return chars + col