1
1
mirror of https://github.com/walles/moar.git synced 2024-09-11 12:15:43 +03:00

Get line numbers style from Chroma style

This commit is contained in:
Johan Walles 2023-12-19 09:06:11 +01:00
parent d511e50652
commit d045cb6d37
2 changed files with 10 additions and 2 deletions

View File

@ -26,3 +26,6 @@ fi
# This line must be last in the script so that its return code
# propagates properly to its caller
go build -ldflags="-s -w -X main.versionString=${VERSION}" -o "${BINARY}"
# Alternative build line, if you want to attach to the running process in the Go debugger:
# go build -ldflags="-X main.versionString=${VERSION}" -gcflags='-N -l' -o "${BINARY}"

View File

@ -77,8 +77,13 @@ func styleUi(chromaStyle *chroma.Style, chromaFormatter *chroma.Formatter, statu
return
}
// FIXME: Get this from the Chroma style
lineNumbersStyle = twin.StyleDefault.WithAttr(twin.AttrDim)
chromaLineNumbers := twinStyleFromChroma(chromaStyle, chromaFormatter, chroma.LineNumbers)
if chromaLineNumbers != nil {
// If somebody can provide an example where not-dimmed line numbers
// looks good I'll change this, but until then they will be dimmed no
// matter what the theme authors think.
lineNumbersStyle = chromaLineNumbers.WithAttr(twin.AttrDim)
}
if standoutStyle != nil {
statusbarStyle = *standoutStyle