editor: Restore selections to positions after last edit (#28527)

Closes #22692

Makes it so when undoing a format operation, the selections are set to
where they were at the last edit.

Release Notes:

- Made it so the cursor position is reset to where it was after the last
edit when undoing a format operation. This will only result in different
behavior when you make an edit, scroll away, initiate formatting (either
by saving or manually) and then undo the format.

---------

Co-authored-by: Zed AI <ai@zed.dev>
fbbc23bec3Ben Kunkle committed on 4/10/2025, 6:33:49 PM· committed by GitHubparent26f4705
3 files changedLine totals unavailable