# Do not subtract gutter margin twice from the editor width \(\#34564\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 4ee52433ae606b095a9054162060e59d33874e16

Requested commit: 4ee52433ae606b095a9054162060e59d33874e16

Commit: 4ee52433ae606b095a9054162060e59d33874e16

Tree: 8e57c29a142519c79d68efe65fc54679d028cd5a

Author: Daniel Sauble

Committer: GitHub

## Message

```
Do not subtract gutter margin twice from the editor width (#34564)

Closes #33176

In auto-height layouts, horizontal autoscroll can occur right before
soft wrapping is triggered. This seems to be caused by gutter margin
being subtracted twice from the editor width.

If we subtract gutter width only once, the horizontal autoscroll
behavior goes away.

Before:


https://github.com/user-attachments/assets/03b6687e-3c0e-4b34-8e07-a228bcc6f798

After:


https://github.com/user-attachments/assets/84e54088-b5bd-4259-a193-d9fcf32cd3a7

Release Notes:

- Fixes issue with auto-height layouts where horizontal autoscroll is
triggered right before text wraps

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
```

## Parents

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

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