gpui: Don't start a wrapped line with closing punctuation or a slash (#62743)

# Objective

`LineWrapper` treats every punctuation character as a break opportunity,
so a wrap can land right before `!`, `?`, `/`, `)`, `]`, `}`, a closing
quote or an ellipsis. Text such as `please fix this plz!`, `8.0/8.0`,
`cli/install`, `(see)` or `“quoted”` then wraps with the closing mark
orphaned at the start of the next line.

## Solution

Add the "UAX 14 LB13 rule" to `LineWrapper::is_word_char`, which is to
not break before `! ? / ) ] } " ” » …`

## Testing

Added unit tests and manually tested myself with a long paragraph in a
gpui app.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable (one
extra `matches!` per character in the wrap loop)

---

Release Notes:

- Fixed text wrapping so closing punctuation and slashes never begin a
wrapped line.

Co-authored-by: Lukas Wirth <lukas@zed.dev>
4278ff36efAlistair Smith committed on 8/26/2026, 8:19:39 AM· committed by GitHubparent74490da
1 file changedLine totals unavailable