Fix panic in diff hunk rendering (#50163) (cherry-pick to stable) (#50165)
zed-zippy[bot]
and
Conrad Irwin
created
Cherry-pick of #50163 to stable
----
When `row_infos.is_empty()` (if you have very very tiny editors) we
could
end up trying to read the first item out of it.
Fixes ZED-5AT
Fixes ZED-54F
Fixes ZED-56N
Updates #49260
cc @Veykril
Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- Fixed a panic rendering diff hunk headers in 0-height editors
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>