Skip to content

Commit c396bb0

Browse files
committed
Note on ASCII assumptions in content_max_width
1 parent 511b757 commit c396bb0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/display/side_by_side.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@ impl SourceDimensions {
201201
//
202202
// This is a crude heuristic because it ignores which lines of
203203
// the file actually get displayed, so we can still end up
204-
// with some superfluous space
204+
// with some superfluous space. It also naively assumes that
205+
// byte length is the same display length, which is generally
206+
// OK because byte length will tend to be larger than the
207+
// display length.
205208
let display_width = min(terminal_width, (content_max_width + 4) * 2 + SPACER.len());
206209

207210
assert!(

0 commit comments

Comments
 (0)