提交 4f6c0de1 编写于 作者: D Derek Parker

Pad single digit line numbers in output

上级 4d8f5659
......@@ -503,7 +503,13 @@ func printcontext(state *api.DebuggerState) error {
arrow = "=>"
}
context = append(context, fmt.Sprintf("\033[34m%s %d\033[0m:\t%s", arrow, i, line))
var lineNum string
if i < 10 {
lineNum = fmt.Sprintf("\033[34m%s %d\033[0m:\t", arrow, i)
} else {
lineNum = fmt.Sprintf("\033[34m%s %d\033[0m:\t", arrow, i)
}
context = append(context, lineNum+line)
}
fmt.Println(strings.Join(context, ""))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册