Skip to content

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

Merged
eholk merged 1 commit intozed-industries:mainfrom
eholk:keep-semicolon-with-preceding-word
Apr 22, 2026
Merged

Keep trailing semicolons attached to the preceding word when wrapping#54546
eholk merged 1 commit intozed-industries:mainfrom
eholk:keep-semicolon-with-preceding-word

Conversation

@eholk
Copy link
Copy Markdown
Contributor

@eholk eholk commented Apr 22, 2026

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.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 22, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Apr 22, 2026
@cole-miller cole-miller self-requested a review April 22, 2026 21:24
@eholk eholk merged commit 2c23789 into zed-industries:main Apr 22, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants