mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-23 09:56:19 +04:00
fix: simplify text reflowing strategy to improve language compatibility (#12048)
This commit is contained in:
parent
887bbbc375
commit
6101b3a7a3
@ -4,6 +4,8 @@
|
||||
/// 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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user