# gpui: Trim trailing whitespace and punctuation before ellipsis \(\#57106\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 46b08f9d7d6f68875cee692f4ae88c902a05ab4a

Requested commit: 46b08f9d7d6f68875cee692f4ae88c902a05ab4a

Commit: 46b08f9d7d6f68875cee692f4ae88c902a05ab4a

Tree: 37bf804e76c4423ad527757ef093da3ae333fdff

Author: Conrad Irwin

Committer: GitHub

## Message

```
gpui: Trim trailing whitespace and punctuation before ellipsis (#57106)

When truncating text at the end with an ellipsis, the truncation point
can land right after a space or punctuation character, producing results
like `"some text …"` or `"some text-…"`.

This trims trailing whitespace and ASCII punctuation from the truncated
prefix before appending the ellipsis affix, so you get clean results
like `"some text…"` instead.

Release Notes:

- Improved text truncation to avoid trailing spaces or punctuation
before the ellipsis.
```

## Parents

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

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