Skip to content

Commit

Permalink
chore: minor UX edits to autocomplete example (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm authored Aug 21, 2023
1 parent 1ad1277 commit 5506e9a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/autocomplete/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
)

func main() {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)",
)
}

0 comments on commit 5506e9a

Please sign in to comment.