Fix various godoc comments

This commit is contained in:
Christian Rocha 2022-01-18 17:15:38 -05:00
parent 505a16d057
commit 091c915462
4 changed files with 17 additions and 4 deletions

View File

@ -165,7 +165,12 @@ func (m Model) FullHelpView(groups [][]key.Binding) string {
}
var (
out []string
// Linter note: at this time we don't think it's worth the additional
// code complexity involved in preallocating this slice.
//
//nolint:prealloc
out []string
totalWidth int
sep = m.Styles.FullSeparator.Render(m.FullSeparator)
sepWidth = lipgloss.Width(sep)

View File

@ -75,6 +75,8 @@ func (f filteredItems) matches() [][]int {
return agg
}
// FilterMatchesMsg contains data about items matched during filtering. The
// message should be routed to Update for processing.
type FilterMatchesMsg []filteredItem
type statusMessageTimeoutMsg struct{}

View File

@ -98,6 +98,11 @@ func WithWidth(w int) Option {
}
}
// WithSpringOptions sets the initial frequency and damping options for the
// progressbar's built-in spring-based animation. Frequency corresponds to
// speed, and damping to bounciness. For details see:
//
// https://github.com/charmbracelet/harmonica
func WithSpringOptions(frequency, damping float64) Option {
return func(m *Model) {
m.SetSpringOptions(frequency, damping)
@ -213,7 +218,8 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// SetSpringOptions sets the frequency and damping for the current spring.
// Frequency corresponds to speed, and damping to bounciness. For details see:
// https://github.com/charmbracelet/harmonica.
//
// https://github.com/charmbracelet/harmonica
func (m *Model) SetSpringOptions(frequency, damping float64) {
m.spring = harmonica.NewSpring(harmonica.FPS(fps), frequency, damping)
}

View File

@ -62,7 +62,7 @@ const (
// seen for password fields on the command line.
EchoNone
// EchoOnEdit
// EchoOnEdit.
)
// blinkCtx manages cursor blinking.
@ -234,7 +234,7 @@ func (m *Model) cursorStart() bool {
return m.setCursor(0)
}
// CursorEnd moves the cursor to the end of the input field
// CursorEnd moves the cursor to the end of the input field.
func (m *Model) CursorEnd() {
m.cursorEnd()
}