# Ensure horizontal scrollbars show as needed \(\#30964\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a47fd1d723245de9fa136c9fa152b0498d99ce08

Requested commit: a47fd1d723245de9fa136c9fa152b0498d99ce08

Commit: a47fd1d723245de9fa136c9fa152b0498d99ce08

Tree: 74e1e27795b892bf6f8cfe4511587ac721cdd2f4

Author: Finn Evers

Committer: GitHub

## Message

```
Ensure horizontal scrollbars show as needed (#30964)

This PR fixes an issue where the horizontal scrollbar was sometimes not
rendered despite being needed for the outline and project panels.

The issue occured since `self.width` does not neccessarily have to be
set when the scrollbar is rendered (it is only set on panel resize).
However, the check for a `width` is not needed at all since the
scrollbar constructor determines whether a scrollbar has to be rendered
or not. Hence, this does not need to be special-cased.

Furthermore, since `Scrollbar::horizontal()` returns `Some(...)` when a
scrollbar needs to be rendered, we do not have to check for this
seperately on the scroll handle and can just map on the option. This
simplifies the code a bit.

| `main` | This PR |
| --- | --- | 
|
![main](https://github.com/user-attachments/assets/db1d4524-716e-42c1-a6f9-7cfd59c94b30)
|
![PR](https://github.com/user-attachments/assets/12536d28-616e-487d-b948-653f53da36b4)
|



Release Notes:

- Fixed an issue where the horizontal scrollbar would not render in the
project and outline panels.
```

## Parents

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

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