Fix panic when deleting just-generated text (#10282)

We ran into a panic when deleting text that was just generated by a code
action.

This fixes it by ensuring we don't run into a 0-minus-1 panic when a
buffer_range is empty.

Release Notes:

- Fixed panic that could occur when deleting generated-by-unsaved text.

Co-authored-by: Conrad <conrad@zed.dev>
4d68bf2fa6Thorsten Ball committed on 4/8/2024, 3:59:25 PM· committed by GitHubparent87c282d
1 file changedLine totals unavailable