Fix inverted char boundary check causing invalid offsets (#47112)

The logic in `anchor_at_offset` and `to_offset` seems inverted when
checking character boundaries. `assert_char_boundary` returns `true`
when the offset IS valid, but the code was adjusting offsets when the
function returned `true` (valid) instead of `false` (invalid).

Release Notes:

- N/A
376e958569Jordi Villar committed on 1/19/2026, 8:08:45 AM· committed by GitHubparent50a90d3
1 file changedLine totals unavailable