Remove double import in textinput example + make a var name less weird

This commit is contained in:
Christian Rocha 2021-02-06 19:14:38 +00:00
parent 479a1ceb35
commit 133a315b2c
1 changed files with 7 additions and 8 deletions

View File

@ -8,7 +8,6 @@ import (
"log"
"github.com/charmbracelet/bubbles/textinput"
input "github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
)
@ -25,19 +24,19 @@ type tickMsg struct{}
type errMsg error
type model struct {
textInput input.Model
textInput textinput.Model
err error
}
func initialModel() model {
inputModel := input.NewModel()
inputModel.Placeholder = "Pikachu"
inputModel.Focus()
inputModel.CharLimit = 156
inputModel.Width = 20
ti := textinput.NewModel()
ti.Placeholder = "Pikachu"
ti.Focus()
ti.CharLimit = 156
ti.Width = 20
return model{
textInput: inputModel,
textInput: ti,
err: nil,
}
}