editor: Fix relative line numbers breaking with nested folds (#47035) (cherry-pick to preview) (#47107)
zed-zippy[bot]
and
Finn Evers
created
Cherry-pick of #47035 to preview
----
Closes #46516
The previous fix only worked for non-nested folds, whereas this one also
considers nested folds properly. Also makes this more straightforward to
read.
Release Notes:
- Fixed an issue where relative line numbering would break with nested
folds.
Co-authored-by: Finn Evers <finn@zed.dev>