summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2024-11-01 07:47:44 +1300
committerBen Bridle <ben@derelict.engineering>2024-11-01 07:48:11 +1300
commit3d66d0b008649c0f9a1cae68b58873230832d4a2 (patch)
treeefe5ec4607b6af647dcecc33a2028ef6e7bc26dc /src
parentfe710b107c5e9902a01ad3e5405b7d9da6ee9844 (diff)
downloadbedrock-asm-3d66d0b008649c0f9a1cae68b58873230832d4a2.zip
Fix minor formatting issue in error messages
The padding for the line numbers in the left margin was being calculated from the length of the zero indexed line number, but the value being printed was the one-indexed line number, so the margin would be offset by a character when an error occurred on a one-indexed line number that was a power of ten.
Diffstat (limited to 'src')
-rw-r--r--src/print.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/print.rs b/src/print.rs
index b2c2ba8..800a1d5 100644
--- a/src/print.rs
+++ b/src/print.rs
@@ -163,8 +163,8 @@ fn print_source_issue(message: &str, context: Context, variant: SourceIssueVaria
// Prepare variables.
let location = &context.source.in_merged;
- let digits = location.start.line.to_string().len();
let y = location.start.line + 1;
+ let digits = y.to_string().len();
let arrow = "-->";
let space = " ";