From c396bb010224c71a19a5e3fe526d30043d89d4a7 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Mon, 21 Oct 2024 22:57:01 -0700 Subject: [PATCH] Note on ASCII assumptions in content_max_width --- src/display/side_by_side.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/display/side_by_side.rs b/src/display/side_by_side.rs index b3a43a68d..888fa2d75 100644 --- a/src/display/side_by_side.rs +++ b/src/display/side_by_side.rs @@ -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!(