From 5506e9a22e2e8c572ca2c53b85b71ef4b43bd7d2 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 21 Aug 2023 13:27:53 -0400 Subject: [PATCH] chore: minor UX edits to autocomplete example (#807) --- examples/autocomplete/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/autocomplete/main.go b/examples/autocomplete/main.go index 5579588..2aba5d8 100644 --- a/examples/autocomplete/main.go +++ b/examples/autocomplete/main.go @@ -9,6 +9,7 @@ import ( "github.com/charmbracelet/bubbles/textinput" tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/lipgloss" ) func main() { @@ -63,7 +64,9 @@ type model struct { func initialModel() model { ti := textinput.New() - ti.Placeholder = "Bubbletea" + ti.Prompt = "charmbracelet/" + ti.Placeholder = "repo..." + ti.Cursor.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("63")) ti.Focus() ti.CharLimit = 50 ti.Width = 20 @@ -99,6 +102,6 @@ func (m model) View() string { return fmt.Sprintf( "What’s your favorite Charm repository?\n\n%s\n\n%s\n", m.textInput.View(), - "(esc to quit)", + "(tab to complete, ctrl+n/ctrl+p to cycle through suggestions, esc to quit)", ) }