Skip to content

Commit 6fa3a4e

Browse files
authored
tools: make v check-md . print the actual length of lines too, when reporting errors/warnings about them (#23606)
1 parent 1197615 commit 6fa3a4e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cmd/tools/vcheck-md.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ struct CheckResultContext {
191191

192192
fn (mut f MDFile) wcheck(actual int, limit int, ctx CheckResultContext, msg_template string) {
193193
if actual > limit {
194-
wprintln(wline(ctx.path, ctx.line_number, ctx.line.len, msg_template.replace('@',
195-
limit.str())))
194+
final := msg_template.replace('@', limit.str()) + ', actual: ' + actual.str()
195+
wprintln(wline(ctx.path, ctx.line_number, ctx.line.len, final))
196196
wprintln(ctx.line)
197197
wprintln(ftext('-'.repeat(limit) + '^', term.gray))
198198
f.warnings++
@@ -201,8 +201,8 @@ fn (mut f MDFile) wcheck(actual int, limit int, ctx CheckResultContext, msg_temp
201201

202202
fn (mut f MDFile) echeck(actual int, limit int, ctx CheckResultContext, msg_template string) {
203203
if actual > limit {
204-
eprintln(eline(ctx.path, ctx.line_number, ctx.line.len, msg_template.replace('@',
205-
limit.str())))
204+
final := msg_template.replace('@', limit.str()) + ', actual: ' + actual.str()
205+
eprintln(eline(ctx.path, ctx.line_number, ctx.line.len, final))
206206
eprintln(ctx.line)
207207
eprintln(ftext('-'.repeat(limit) + '^', term.gray))
208208
f.errors++

0 commit comments

Comments
 (0)