mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-16 01:43:21 +00:00
chore(textarea): remove pointer receiver on update and view (#858)
Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
This commit is contained in:
co-authored by
Ayman Bagabas
parent
faa17cbbd6
commit
84a82dfeee
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user