# Fix scrollbar auto-show for cursors out of sight \(\#11244\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 4b767697af944ac638eef624d33eca42cb620eaf

Requested commit: 4b767697af944ac638eef624d33eca42cb620eaf

Commit: 4b767697af944ac638eef624d33eca42cb620eaf

Tree: b5bcf8bfc64ee15c26659aae9c0fde14b74e8b3f

Author: Andrew Lygin

Committer: GitHub

## Message

```
Fix scrollbar auto-show for cursors out of sight (#11244)

This PR fixes scrollbar auto-show feature when there're not visible
cursors. The intial behavior was broken in #11147.

The problem is that `selections` only contains visible selections, so
the `if` with `non_visible_cursors |= true` is only visited in rare edge
cases when we have at least part of the selection still visible on the
screen. But when we scroll far enough from the cursor,
`non_visible_cursors` keeps its default `false` value, which is
incorrect.

Release Notes:

- N/A
```

## Parents

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

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