Skip to content

Commit

Permalink
Fixing wrapping regarding \n
Browse files Browse the repository at this point in the history
Related to #59
  • Loading branch information
Yomguithereal committed Sep 29, 2023
1 parent 10d4a2c commit b0e01ad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ pub fn unicode_aware_wrap(string: &str, max_width: usize, indent: usize) -> Stri
let mut current_width: usize = 0;

for grapheme in string.graphemes(true) {
if grapheme == "\n" {
lines.push(current_string);
current_string = String::new();
continue;
}

let width = grapheme.width();
current_width += width;

Expand Down

0 comments on commit b0e01ad

Please sign in to comment.