editor: Fix rare panic in wrap map (#39379)

Closes ZED-1SV
Closes ZED-TG
Closes ZED-22G
Closes ZED-22J

This seems to fix the reported error there, but ultimately, this might
benefit from a test to reproduce. Hence, marking as draft for now.

Release Notes:

- Fixed a rare panic whilst wrapping lines.
62e3a49212Finn Evers committed on 11/10/2025, 8:08:48 PM· committed by GitHubparent87d0401
2 files changedLine totals unavailable