# Consolidate calculation of editor's visible row range · gitcafe/zed

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

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

Visibility: public

Requested revision: 864020463f4850decebd2eaf22ba8eaddbc10097

Requested commit: 864020463f4850decebd2eaf22ba8eaddbc10097

Commit: 864020463f4850decebd2eaf22ba8eaddbc10097

Tree: a3e259fb6ac8ef07596c68be4122388e40c94b0a

Author: Max Brunsfeld

Committer: Max Brunsfeld

## Message

```
Consolidate calculation of editor's visible row range

We think this will fix a panic that was occuring in `paint_highlighted_range`
due to an out-of-bounds read into the line layouts. We think doing essentially the same
calculation in two different ways with floating point numbers might have
caused a different end row to be calculated in 2 different code paths.

Co-authored-by: Nathan Sobo <nathan@zed.dev>

```

## Parents

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

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