# editor: Do not insert scrollbar hitboxes when scrollbars are never to be shown \(\#29316\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 6bacea28bca63e85946d9fcdd1ef1404d015d82d

Requested commit: 6bacea28bca63e85946d9fcdd1ef1404d015d82d

Commit: 6bacea28bca63e85946d9fcdd1ef1404d015d82d

Tree: e9d3bc2a09eec6aa789238784323a8744a0885bd

Author: Finn Evers

Committer: GitHub

## Message

```
editor: Do not insert scrollbar hitboxes when scrollbars are never to be shown (#29316)

This PR fixes an issue where scrollbar hitboxes were still inserted for
editors despite scrollbars being programmatically disabled via the
`show_scrollbars`field. This is basically the same fix as in #27467.

The thought process here is that the motivation for `show_scrollbars` is
not to just hide the scrollbars in the editor, but to fully disable
scrollbars for the associated editor. However, this is currently not the
case, as a functioning hitbox for each scrollbar is stil inserted. For
example, the behavior with the old assistant panel can be seen below:


https://github.com/user-attachments/assets/18af6338-dd28-4794-a6a6-5b9691b243f2

Whilst the scrollbar is not visible, there is still a scrollbar hitbox
inserted which triggers hover events and is fully functioning.


This PR fixes this by fully skipping the scrollbar layouting whenever
`show_scrollbars` is set to false, preventing the hitboxes from being
inserted.


https://github.com/user-attachments/assets/b6bb6dc7-902f-4383-bf03-506d0a57ec77


Release Notes:

- N/A
```

## Parents

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

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