Skip to content
Myr

Use consts for default values

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Muehlhaeuser · committed by Christian Muehlhaeuser · parent cd4e02b · Browse files · 2 files+10 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−2 removed

  • other:+10 added−2 removed

2 files+10 added−2 removed

modified:spinner/spinner.go+5 added-1 removed
14 unmodified lines
15 Line Spinner = iota16 Dot17)1819const (20 defaultFPS = 921)2223var (24 // Spinner frames25 spinners = map[Spinner][]string{26 Line: {"|", "/", "-", "\\"},
37 unmodified lines
64// NewModel returns a model with default values.65func NewModel() Model {66 return Model{67 Type: Line,64 FPS: 9,68 FPS: defaultFPS,69 }70}7172// TickMsg indicates that the timer has ticked and we should render a frame.
46 unmodified lines
modified:textinput/textinput.go+5 added-1 removed
6 unmodified lines
7 "github.com/charmbracelet/boba"8 "github.com/muesli/termenv"9)1011const (12 defaultBlinkSpeed = time.Millisecond * 60013)1415var (16 // color is a helper for returning colors17 color func(s string) termenv.Color = termenv.ColorProfile().Color18)
144 unmodified lines
163// NewModel creates a new model with default settings.164func NewModel() Model {165 return Model{166 Prompt: "> ",163 BlinkSpeed: time.Millisecond * 600,167 BlinkSpeed: defaultBlinkSpeed,168 Placeholder: "",169 TextColor: "",170 PlaceholderColor: "240",171 CursorColor: "",
182 unmodified lines