chore(textarea): remove pointer receiver on update and view (#858)

Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
This commit is contained in:
Christian Rocha
2025-11-10 16:10:18 -05:00
committed by GitHub
co-authored by Ayman Bagabas
parent faa17cbbd6
commit 84a82dfeee
2 changed files with 73 additions and 73 deletions
+4 -4
View File
@@ -338,7 +338,7 @@ type Model struct {
}
// New creates a new model with default settings.
func New() *Model {
func New() Model {
vp := viewport.New()
vp.KeyMap = viewport.KeyMap{}
cur := cursor.New()
@@ -369,7 +369,7 @@ func New() *Model {
m.SetHeight(defaultHeight)
m.SetWidth(defaultWidth)
return &m
return m
}
// DefaultStyles returns the default styles for focused and blurred states for
@@ -1161,7 +1161,7 @@ func (m *Model) SetHeight(h int) {
}
// Update is the Bubble Tea update loop.
func (m *Model) Update(msg tea.Msg) (*Model, tea.Cmd) {
func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
if !m.focus {
m.virtualCursor.Blur()
return m, nil
@@ -1407,7 +1407,7 @@ func (m *Model) view() string {
}
// View renders the text area in its current state.
func (m *Model) View() string {
func (m Model) View() string {
// XXX: This is a workaround for the case where the viewport hasn't
// been initialized yet like during the initial render. In that case,
// we need to render the view again because Update hasn't been called