Fix various typos in examples

This commit is contained in:
Christian Muehlhaeuser 2021-03-12 02:11:26 +01:00
parent d2c1d9bfb0
commit b6c7f93d9a
4 changed files with 8 additions and 8 deletions

View File

@ -123,7 +123,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// Because we're using the viewport's default update function (with pager-
// style navigation) it's important that the viewport's update function:
//
// * Recieves messages from the Bubble Tea runtime
// * Receives messages from the Bubble Tea runtime
// * Returns commands to the Bubble Tea runtime
//
m.viewport, cmd = m.viewport.Update(msg)
@ -136,7 +136,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (m model) View() string {
if !m.ready {
return "\n Initalizing..."
return "\n Initializing..."
}
headerTop := "╭───────────╮"

View File

@ -13,7 +13,7 @@ import (
tea "github.com/charmbracelet/bubbletea"
)
// A message used to indicate that activity has occured. In the real world (for
// A message used to indicate that activity has occurred. In the real world (for
// example, chat) this would contain actual data.
type responseMsg struct{}

View File

@ -38,9 +38,9 @@ func (m model) Init() tea.Cmd {
return tick
}
// Update is called when messages are recived. The idea is that you inspect the
// Update is called when messages are received. The idea is that you inspect the
// message and send back an updated model accordingly. You can also return
// a commmand, which is a function that peforms I/O and returns a message.
// a command, which is a function that peforms I/O and returns a message.
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg.(type) {
case tea.KeyMsg:

View File

@ -86,7 +86,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
}
// Hand off the message and model to the approprate update function for the
// Hand off the message and model to the appropriate update function for the
// appropriate view based on the current state.
if !m.Chosen {
return updateChoices(msg, m)
@ -94,7 +94,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return updateChosen(msg, m)
}
// The main view, which just calls the approprate sub-view
// The main view, which just calls the appropriate sub-view
func (m model) View() string {
var s string
if m.Quitting {
@ -273,7 +273,7 @@ func makeRamp(colorA, colorB string, steps float64) (s []string) {
return
}
// Convert a colorful.Color to a hexidecimal format compatible with termenv.
// Convert a colorful.Color to a hexadecimal format compatible with termenv.
func colorToHex(c colorful.Color) string {
return fmt.Sprintf("#%s%s%s", colorFloatToHex(c.R), colorFloatToHex(c.G), colorFloatToHex(c.B))
}