1
1
mirror of https://github.com/walles/moar.git synced 2024-11-30 02:34:13 +03:00

Left pad line numbers

Fixes a regression, this is what it used to look like and should have
looked like all the time.
This commit is contained in:
Johan Walles 2021-05-22 15:39:39 +02:00
parent da47a1730e
commit dc070cad75

View File

@ -122,6 +122,7 @@ func (p *Pager) _AddLine(fileLineNumber *int, numberPrefixLength int, screenLine
lineNumberString := ""
if numberPrefixLength > 0 && fileLineNumber != nil {
lineNumberString = formatNumber(uint(*fileLineNumber))
lineNumberString = fmt.Sprintf("%*s", numberPrefixLength-1, lineNumberString)
if len(lineNumberString) > numberPrefixLength {
panic(fmt.Errorf(
"lineNumberString <%s> longer than numberPrefixLength %d",