# Fix relative line number calculation when the first row is wrapped \(\#53759\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/da2b62c917f5171eb0bf1bb1ec3168e5d6093b99)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: da2b62c917f5171eb0bf1bb1ec3168e5d6093b99

Requested commit: da2b62c917f5171eb0bf1bb1ec3168e5d6093b99

Commit: da2b62c917f5171eb0bf1bb1ec3168e5d6093b99

Tree: 557fd253b0b59f5459cf06ec1e2e3a9dc072a4f0

Author: \./daniele

Committer: GitHub

## Message

```
Fix relative line number calculation when the first row is wrapped (#53759)

fixes #53726
Compute the base delta from the first visible, non-filtered row instead
of using rows.start. This avoids off-by-one numbering when rows.start is
a wrapped continuation that gets filtered out. Ensure deleted lines
still advance the relative counter even when they are not numbered. Add
a test for the wrapped scrolling case.
P.S. This is my first time using rust for a serious pull request and
let's say I'm a little bit rusty with it.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
```

## Parents

- [9375695626f1bba18ae5ba3153aa200c999e342e](https://git.cafe/gitcafe/zed/commit/9375695626f1bba18ae5ba3153aa200c999e342e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/da2b62c917f5171eb0bf1bb1ec3168e5d6093b99?format=markdown)
