Skip to content

Commit

Permalink
fix: simplify text reflowing strategy to improve language compatibili…
Browse files Browse the repository at this point in the history
…ty (#12048)
  • Loading branch information
spx01 authored Nov 20, 2024
1 parent 887bbbc commit 6101b3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion helix-core/src/wrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use textwrap::{Options, WordSplitter::NoHyphenation};
/// Given a slice of text, return the text re-wrapped to fit it
/// within the given width.
pub fn reflow_hard_wrap(text: &str, text_width: usize) -> SmartString<LazyCompact> {
let options = Options::new(text_width).word_splitter(NoHyphenation);
let options = Options::new(text_width)
.word_splitter(NoHyphenation)
.word_separator(textwrap::WordSeparator::AsciiSpace);
textwrap::refill(text, options).into()
}

0 comments on commit 6101b3a

Please sign in to comment.