Skip to content

Commit

Permalink
Note on ASCII assumptions in content_max_width
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Oct 22, 2024
1 parent 511b757 commit c396bb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/display/side_by_side.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ impl SourceDimensions {
//
// This is a crude heuristic because it ignores which lines of
// the file actually get displayed, so we can still end up
// with some superfluous space
// with some superfluous space. It also naively assumes that
// byte length is the same display length, which is generally
// OK because byte length will tend to be larger than the
// display length.
let display_width = min(terminal_width, (content_max_width + 4) * 2 + SPACER.len());

assert!(
Expand Down

0 comments on commit c396bb0

Please sign in to comment.