Keep the bounded source prefixes needed to highlight a diff.
Idempotent, and rehydration depends on it: DiffMessage.__init__ calls this
on whatever it is handed, which is the full file from the live path but an
already-trimmed prefix from MessageData. Re-trimming a prefix must return it
unchanged, so any future trimming rule has to stay keyed on the diff's line
numbers rather than on a count relative to the input, and has to survive the
split/join round trip — see the trailing-newline case in
_highlight_source_prefix. test_trimming_a_prefix_again_returns_it_unchanged
pins this.
Unified diff string.
Content before the change — the whole file, or a prefix this function previously returned.
Content after the change, same contract.