mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-14 08:46:39 -07:00
docs: fix lint issues in examples and tutorials (#759)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b2d2ac6504
commit
b80eb8303b
@@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/charmbracelet/bubbles/cursor"
|
||||
"github.com/charmbracelet/bubbles/textinput"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
@@ -28,7 +29,7 @@ var (
|
||||
type model struct {
|
||||
focusIndex int
|
||||
inputs []textinput.Model
|
||||
cursorMode textinput.CursorMode
|
||||
cursorMode cursor.Mode
|
||||
}
|
||||
|
||||
func initialModel() model {
|
||||
@@ -39,7 +40,7 @@ func initialModel() model {
|
||||
var t textinput.Model
|
||||
for i := range m.inputs {
|
||||
t = textinput.New()
|
||||
t.CursorStyle = cursorStyle
|
||||
t.Cursor.Style = cursorStyle
|
||||
t.CharLimit = 32
|
||||
|
||||
switch i {
|
||||
@@ -77,12 +78,12 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
// Change cursor mode
|
||||
case "ctrl+r":
|
||||
m.cursorMode++
|
||||
if m.cursorMode > textinput.CursorHide {
|
||||
m.cursorMode = textinput.CursorBlink
|
||||
if m.cursorMode > cursor.CursorHide {
|
||||
m.cursorMode = cursor.CursorBlink
|
||||
}
|
||||
cmds := make([]tea.Cmd, len(m.inputs))
|
||||
for i := range m.inputs {
|
||||
cmds[i] = m.inputs[i].SetCursorMode(m.cursorMode)
|
||||
cmds[i] = m.inputs[i].Cursor.SetMode(m.cursorMode)
|
||||
}
|
||||
return m, tea.Batch(cmds...)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user