Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: simplify text reflowing strategy to improve language compatibility #12048

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

spx01
Copy link
Contributor

@spx01 spx01 commented Nov 10, 2024

The the way the textwrap crate is configured results in the reflow command utilizing a more sophisticated word separator (WordSeparator::UnicodeBreakProperties). As there is currently no mechanism for language-aware reflowing, this approach results in issues like links breaking from their labels in Markdown (#12003). Explicitly using the simpler ASCII space separator addresses this issue and, in my opinion, serves as a better default behavior.

Signed-off-by: spx01 <42381535+spx01@users.noreply.github.com>
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we want to remove textwrap and reimplement :reflow in terms of the soft wrapping functionality (#11738). This is a tiny change though so I think it'd be ok to merge anyways

@the-mikedavis the-mikedavis linked an issue Nov 20, 2024 that may be closed by this pull request
@the-mikedavis the-mikedavis merged commit 6101b3a into helix-editor:master Nov 20, 2024
6 checks passed
@spx01 spx01 deleted the reflow-on-space branch November 21, 2024 04:32
GladkihEgor pushed a commit to GladkihEgor/helix that referenced this pull request Jan 4, 2025
diucicd pushed a commit to diucicd/helix that referenced this pull request Jan 8, 2025
rmburg pushed a commit to rmburg/helix that referenced this pull request Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reflow breaks markdown links
2 participants