fix(examples): revert textarea pointers to values
Fixes: 6a65a1f (chore(docs): update examples and dependencies for v2-exp)
This commit is contained in:
parent
39e9984571
commit
8f17c3584f
6 changed files with 10 additions and 14 deletions
|
|
@ -25,7 +25,7 @@ func main() {
|
|||
type model struct {
|
||||
viewport viewport.Model
|
||||
messages []string
|
||||
textarea *textarea.Model
|
||||
textarea textarea.Model
|
||||
senderStyle lipgloss.Style
|
||||
err error
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ go 1.24.3
|
|||
replace charm.land/bubbletea/v2 => ../
|
||||
|
||||
require (
|
||||
charm.land/bubbles/v2 v2.0.0-beta.1.0.20251106192719-c2b822795a69
|
||||
charm.land/bubbles/v2 v2.0.0-beta.1.0.20251110211018-84a82dfeeed8
|
||||
charm.land/bubbletea/v2 v2.0.0-rc.1.0.20251106192006-06c0cda318b3
|
||||
charm.land/lipgloss/v2 v2.0.0-beta.3.0.20251106193318-19329a3e8410
|
||||
github.com/charmbracelet/colorprofile v0.3.3
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
charm.land/bubbles/v2 v2.0.0-beta.1.0.20251106192719-c2b822795a69 h1:NDGTUMVrofPXnt/GWrEq9ocy2u6wXgG/Iy08yV9hYWw=
|
||||
charm.land/bubbles/v2 v2.0.0-beta.1.0.20251106192719-c2b822795a69/go.mod h1:IgPJ3gPe7pVotzof0AYkt+FKBnoLK/KrfxWcfbful4I=
|
||||
charm.land/bubbles/v2 v2.0.0-beta.1.0.20251110211018-84a82dfeeed8 h1:2bzaNBvZHgpLjxlQTDjoeY0YGjQtMflWiDZMEbviiRE=
|
||||
charm.land/bubbles/v2 v2.0.0-beta.1.0.20251110211018-84a82dfeeed8/go.mod h1:5AbN6cEd/47gkEf8TgiQ2O3RZ5QxMS14l9W+7F9fPC4=
|
||||
charm.land/lipgloss/v2 v2.0.0-beta.3.0.20251106193318-19329a3e8410 h1:D9PbaszZYpB4nj+d6HTWr1onlmlyuGVNfL9gAi8iB3k=
|
||||
charm.land/lipgloss/v2 v2.0.0-beta.3.0.20251106193318-19329a3e8410/go.mod h1:1qZyvvVCenJO2M1ac2mX0yyiIZJoZmDM4DG4s0udJkU=
|
||||
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ func filter(teaModel tea.Model, msg tea.Msg) tea.Msg {
|
|||
}
|
||||
|
||||
type model struct {
|
||||
textarea *textarea.Model
|
||||
textarea textarea.Model
|
||||
help help.Model
|
||||
keymap keymap
|
||||
saveText string
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ type keymap = struct {
|
|||
next, prev, add, remove, quit key.Binding
|
||||
}
|
||||
|
||||
func newTextarea() *textarea.Model {
|
||||
func newTextarea() textarea.Model {
|
||||
t := textarea.New()
|
||||
t.Prompt = ""
|
||||
t.Placeholder = "Type something"
|
||||
|
|
@ -77,13 +77,13 @@ type model struct {
|
|||
height int
|
||||
keymap keymap
|
||||
help help.Model
|
||||
inputs []*textarea.Model
|
||||
inputs []textarea.Model
|
||||
focus int
|
||||
}
|
||||
|
||||
func newModel() model {
|
||||
m := model{
|
||||
inputs: make([]*textarea.Model, initialInputs),
|
||||
inputs: make([]textarea.Model, initialInputs),
|
||||
help: help.New(),
|
||||
keymap: keymap{
|
||||
next: key.NewBinding(
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ import (
|
|||
"log"
|
||||
"strings"
|
||||
|
||||
tea "charm.land/bubbletea/v2"
|
||||
"charm.land/bubbles/v2/textarea"
|
||||
tea "charm.land/bubbletea/v2"
|
||||
"charm.land/lipgloss/v2"
|
||||
)
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ func main() {
|
|||
type errMsg error
|
||||
|
||||
type model struct {
|
||||
textarea *textarea.Model
|
||||
textarea textarea.Model
|
||||
err error
|
||||
}
|
||||
|
||||
|
|
@ -49,9 +49,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||
var cmd tea.Cmd
|
||||
|
||||
switch msg := msg.(type) {
|
||||
case tea.WindowSizeMsg:
|
||||
m.textarea.SetWidth(msg.Width)
|
||||
m.textarea.SetHeight(msg.Height)
|
||||
case tea.BackgroundColorMsg:
|
||||
// Update styling now that we know the background color.
|
||||
m.textarea.SetStyles(textarea.DefaultStyles(msg.IsDark()))
|
||||
|
|
@ -108,7 +105,6 @@ func (m model) View() tea.View {
|
|||
}, "\n")
|
||||
|
||||
v := tea.NewView(f)
|
||||
v.AltScreen = true
|
||||
v.Cursor = c
|
||||
return v
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue