Function
newChatInput
(width int, history []string)
Source from the content-addressed store, hash-verified
| 36 | } |
| 37 | |
| 38 | func newChatInput(width int, history []string) chatInputModel { |
| 39 | ti := textinput.New() |
| 40 | ti.Prompt = "❯ " |
| 41 | ti.PromptStyle = promptStyle |
| 42 | ti.CharLimit = 0 |
| 43 | ti.Width = max(width-6, 20) // leave room for borders + padding |
| 44 | ti.Focus() |
| 45 | return chatInputModel{ |
| 46 | ti: ti, |
| 47 | history: history, |
| 48 | histIdx: -1, |
| 49 | width: width, |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | func (m chatInputModel) Init() tea.Cmd { return textinput.Blink } |
| 54 | |
Tested by
no test coverage detected