```python
def trim_to(line: str, limit: int) -> str:
    if limit < 4:
        raise ValueError("Limit must be at least 4")

    if len(line) <= limit:
        return line

    # Find the last space before the limit to cut
    space_index = line.rfind(' ', limit - 3)

    if space_index == -1:
        # No space found, so we cut right up until the limit
        return line[:limit] + '...'

    # Cut at the last space found
    return line[:space_index] + '...'
```