MCPcopy Index your code
hub / github.com/docker/docker-agent / chromaTokenStyle

Function chromaTokenStyle

cmd/root/agent_picker.go:510–523  ·  view source on GitHub ↗

chromaTokenStyle maps a chroma token type to a lipgloss style using the given chroma style (theme).

(tokenType chroma.TokenType, style *chroma.Style)

Source from the content-addressed store, hash-verified

508// chromaTokenStyle maps a chroma token type to a lipgloss style using the
509// given chroma style (theme).
510func chromaTokenStyle(tokenType chroma.TokenType, style *chroma.Style) lipgloss.Style {
511 entry := style.Get(tokenType)
512 s := lipgloss.NewStyle()
513 if entry.Colour.IsSet() {
514 s = s.Foreground(lipgloss.Color(entry.Colour.String()))
515 }
516 if entry.Bold == chroma.Yes {
517 s = s.Bold(true)
518 }
519 if entry.Italic == chroma.Yes {
520 s = s.Italic(true)
521 }
522 return s
523}
524
525func (m *agentPickerModel) View() tea.View {
526 var body string

Callers 1

highlightYAMLFunction · 0.85

Calls 2

GetMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected