# Keep trailing semicolons attached to the preceding word when wrapping \(\#54546\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 2c237899f9b52077155aed78dfea7d57446b7b61

Requested commit: 2c237899f9b52077155aed78dfea7d57446b7b61

Commit: 2c237899f9b52077155aed78dfea7d57446b7b61

Tree: f7aaaa4176fcf3dca2383eef5e8e353920f57854

Author: Eric Holk

Committer: GitHub

## Message

```
Keep trailing semicolons attached to the preceding word when wrapping (#54546)

When soft-wrapping text, `LineWrapper::is_word_char` determines which
characters stick to the preceding word at wrap boundaries. The list
already includes trailing punctuation like `,`, `.`, and `:`, but was
missing `;`. As a result, a message like "we won't pass it on; no big
deal" could wrap with `;` isolated at the start of the next line (`on` /
`; no`).

This was most visible in the agent panel message editor but affects any
surface that uses soft-wrapping.

Also adds `assert_word("on;")` to `test_is_word_char` to guard against
regressions.

Release Notes:

- Fixed trailing `;` being wrapped to a new line instead of staying
attached to the preceding word.
```

## Parents

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

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