# Fix relative line numbers in sticky headers \(\#45164\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 4ef5d2c8148e555388668b094e059633c5bc405a

Requested commit: 4ef5d2c8148e555388668b094e059633c5bc405a

Commit: 4ef5d2c8148e555388668b094e059633c5bc405a

Tree: 588325b9ce06957065842a15fd4a1a2c41d47f50

Author: Andrew Farkas

Committer: GitHub

## Message

```
Fix relative line numbers in sticky headers (#45164)

Closes #42586 

This includes a rewrite of `calculate_relative_line_numbers()`. Now it's
linear-time with respect to the number of rows displayed, instead of
linear time with respect to the number of rows displayed _plus_ the
distance to the base row.

Release Notes:

- Improved performance when using relative line numbers in large files
- Fixed relative line numbers not appearing in sticky headers
```

## Parents

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

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