diff --git a/helix-core/src/wrap.rs b/helix-core/src/wrap.rs index 2ba8d173e..f32d6f4bc 100644 --- a/helix-core/src/wrap.rs +++ b/helix-core/src/wrap.rs @@ -1,7 +1,9 @@ use smartstring::{LazyCompact, SmartString}; +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 { - textwrap::refill(text, text_width).into() + let options = Options::new(text_width).word_splitter(NoHyphenation); + textwrap::refill(text, options).into() }