From 4880cf2a09340b307fd037cefad81f7751fc4430 Mon Sep 17 00:00:00 2001 From: Glenn Gonda Date: Sat, 18 Feb 2023 20:30:17 -0800 Subject: [PATCH] docs: fix typos and clean up comments --- examples/credit-card-form/main.go | 2 +- examples/help/main.go | 2 +- examples/simple/main.go | 2 +- examples/textarea/main.go | 2 +- examples/tui-daemon-combo/main.go | 2 +- mouse.go | 4 ++-- options.go | 4 ++-- tutorials/basics/README.md | 4 ++-- tutorials/basics/main.go | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/credit-card-form/main.go b/examples/credit-card-form/main.go index 5ac6854..ba5b2b3 100644 --- a/examples/credit-card-form/main.go +++ b/examples/credit-card-form/main.go @@ -71,7 +71,7 @@ func ccnValidator(s string) error { func expValidator(s string) error { // The 3 character should be a slash (/) - // The rest thould be numbers + // The rest should be numbers e := strings.ReplaceAll(s, "/", "") _, err := strconv.ParseInt(e, 10, 64) if err != nil { diff --git a/examples/help/main.go b/examples/help/main.go index caedc9e..fb382ce 100644 --- a/examples/help/main.go +++ b/examples/help/main.go @@ -87,7 +87,7 @@ func (m model) Init() tea.Cmd { func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.WindowSizeMsg: - // If we set a width on the help menu it can it can gracefully truncate + // If we set a width on the help menu it can gracefully truncate // its view as needed. m.help.Width = msg.Width diff --git a/examples/simple/main.go b/examples/simple/main.go index 478f95a..f1201fd 100644 --- a/examples/simple/main.go +++ b/examples/simple/main.go @@ -56,7 +56,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, nil } -// Views return a string based on data in the model. That string which will be +// View returns a string based on data in the model. That string which will be // rendered to the terminal. func (m model) View() string { return fmt.Sprintf("Hi. This program will exit in %d seconds. To quit sooner press any key.\n", m) diff --git a/examples/textarea/main.go b/examples/textarea/main.go index 109059c..68d1097 100644 --- a/examples/textarea/main.go +++ b/examples/textarea/main.go @@ -1,6 +1,6 @@ package main -// A simple program demonstrating the text input component from the Bubbles +// A simple program demonstrating the textarea component from the Bubbles // component library. import ( diff --git a/examples/tui-daemon-combo/main.go b/examples/tui-daemon-combo/main.go index df26034..962da81 100644 --- a/examples/tui-daemon-combo/main.go +++ b/examples/tui-daemon-combo/main.go @@ -123,7 +123,7 @@ func (m model) View() string { return indent.String(s, 1) } -// processFinishedMsg is send when a pretend process completes. +// processFinishedMsg is sent when a pretend process completes. type processFinishedMsg time.Duration // pretendProcess simulates a long-running process. diff --git a/mouse.go b/mouse.go index 5ff3a2f..f918d20 100644 --- a/mouse.go +++ b/mouse.go @@ -5,9 +5,9 @@ import ( "errors" ) -// MouseMsg contains information about a mouse event and are sent to a programs +// MouseMsg contains information about a mouse event and is sent to a program's // update function when mouse activity occurs. Note that the mouse must first -// be enabled via in order the mouse events to be received. +// be enabled in order for the mouse events to be received. type MouseMsg MouseEvent // MouseEvent represents a mouse event, which could be a click, a scroll wheel diff --git a/options.go b/options.go index d9ce42c..9945924 100644 --- a/options.go +++ b/options.go @@ -41,7 +41,7 @@ func WithInput(input io.Reader) ProgramOption { } } -// WithInputTTY open a new TTY for input (or console input device on Windows). +// WithInputTTY opens a new TTY for input (or console input device on Windows). func WithInputTTY() ProgramOption { return func(p *Program) { p.startupOptions |= withInputTTY @@ -144,7 +144,7 @@ func WithoutRenderer() ProgramOption { // WithANSICompressor removes redundant ANSI sequences to produce potentially // smaller output, at the cost of some processing overhead. // -// This feature is provisional, and may be changed removed in a future version +// This feature is provisional, and may be changed or removed in a future version // of this package. func WithANSICompressor() ProgramOption { return func(p *Program) { diff --git a/tutorials/basics/README.md b/tutorials/basics/README.md index 57ccd48..8e1a26d 100644 --- a/tutorials/basics/README.md +++ b/tutorials/basics/README.md @@ -64,7 +64,7 @@ func initialModel() model { choices: []string{"Buy carrots", "Buy celery", "Buy kohlrabi"}, // A map which indicates which choices are selected. We're using - // the map like a mathematical set. The keys refer to the indexes + // the map like a mathematical set. The keys refer to the indexes // of the `choices` slice, above. selected: make(map[int]struct{}), } @@ -154,7 +154,7 @@ the Bubble Tea runtime to quit, exiting the program. At last, it’s time to render our UI. Of all the methods, the view is the simplest. We look at the model in its current state and use it to return -a `string`. That string is our UI! +a `string`. That string is our UI! Because the view describes the entire UI of your application, you don’t have to worry about redrawing logic and stuff like that. Bubble Tea takes care of it diff --git a/tutorials/basics/main.go b/tutorials/basics/main.go index 0c5b573..4970290 100644 --- a/tutorials/basics/main.go +++ b/tutorials/basics/main.go @@ -18,7 +18,7 @@ func initialModel() model { choices: []string{"Buy carrots", "Buy celery", "Buy kohlrabi"}, // A map which indicates which choices are selected. We're using - // the map like a mathematical set. The keys refer to the indexes + // the map like a mathematical set. The keys refer to the indexes // of the `choices` slice, above. selected: make(map[int]struct{}), }