Skip to content

Commit

Permalink
fix: start line numbers at 1 (was a regression)
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Feb 22, 2022
1 parent a43daef commit 56bacc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func withLineNumber(s string, color bool) string {
// because we're only dealing with digits, which are one byte each.
mll := len(fmt.Sprintf("%d", len(lines)))
for i, l := range lines {
digit := fmt.Sprintf("%*d", mll, i)
digit := fmt.Sprintf("%*d", mll, i+1)
bar := "│"
if color {
digit = lineDigitStyle.Render(digit)
Expand Down

0 comments on commit 56bacc1

Please sign in to comment.