# editor: Fix soft-wrap in auto-height editors \(\#54051\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 555326aea451fd7c8273e726d045e7baac6ef84c

Requested commit: 555326aea451fd7c8273e726d045e7baac6ef84c

Commit: 555326aea451fd7c8273e726d045e7baac6ef84c

Tree: 2269f243c83d251b13e619a1ae62666903d26950

Author: Piotr Osiewicz

Committer: GitHub

## Message

````
editor: Fix soft-wrap in auto-height editors (#54051)

We had an internal report of soft wrap not working in git panel's commit
editor. Given the following settings:
```json
{
  "languages": {
    "Git Commit": {
      "preferred_line_length": 80,
      "soft_wrap": "preferred_line_length",
    },
  },
}
```
We would not soft-wrap in narrow viewports. As it turned out, the
problem was that we were always prefering a `preferred_line_length` as
our soft wrap boundary over the actual width of the editor.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Fixed git commits editor not respecting soft wrap boundaries.
- settings: Removed `"soft_wrap": "preferred_line_length"` in favour of
`"soft_wrap": "bounded"`. Soft wrap now always respects editor width
when it's enabled.
````

## Parents

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

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