From b6c7f93d9a8600625399686010f977739b5438af Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 12 Mar 2021 02:11:26 +0100 Subject: [PATCH] Fix various typos in examples --- examples/pager/main.go | 4 ++-- examples/realtime/main.go | 2 +- examples/simple/main.go | 4 ++-- examples/views/main.go | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/pager/main.go b/examples/pager/main.go index 0970819..0270cd1 100644 --- a/examples/pager/main.go +++ b/examples/pager/main.go @@ -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 := "╭───────────╮" diff --git a/examples/realtime/main.go b/examples/realtime/main.go index c2bd4c9..db80880 100644 --- a/examples/realtime/main.go +++ b/examples/realtime/main.go @@ -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{} diff --git a/examples/simple/main.go b/examples/simple/main.go index dd0cc86..48cc097 100644 --- a/examples/simple/main.go +++ b/examples/simple/main.go @@ -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: diff --git a/examples/views/main.go b/examples/views/main.go index 6bc1143..5b4ed92 100644 --- a/examples/views/main.go +++ b/examples/views/main.go @@ -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)) }