Skip to content

Commit

Permalink
fix(clap): Early line wrap ascii control chars
Browse files Browse the repository at this point in the history
counting ascii control sequences lead to unpredictable and early
line breaks on colorized inputs (e.g. syntax highlighted strings)
  • Loading branch information
hargut committed Oct 8, 2022
1 parent 95c6388 commit 505f760
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/output/textwrap/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pub(crate) fn display_width(text: &str) -> usize {
control_sequence = true;
} else if control_sequence && ch == control_terminate {
control_sequence = false;
continue;
}

if !control_sequence {
Expand Down

0 comments on commit 505f760

Please sign in to comment.