mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-23 14:22:58 +03:00
fix(textarea): pre-allocation of value (#213)
The maximum slice size of m.value is the max number of rows, which is the max height.
This commit is contained in:
parent
e72e4a190b
commit
649f78e1fd
@ -193,7 +193,7 @@ func New() Model {
|
||||
Cursor: cur,
|
||||
KeyMap: DefaultKeyMap,
|
||||
|
||||
value: make([][]rune, minHeight, maxWidth),
|
||||
value: make([][]rune, minHeight, maxHeight),
|
||||
focus: false,
|
||||
col: 0,
|
||||
row: 0,
|
||||
@ -409,7 +409,7 @@ func (m *Model) Blur() {
|
||||
|
||||
// Reset sets the input to its default state with no input.
|
||||
func (m *Model) Reset() {
|
||||
m.value = make([][]rune, minHeight, maxWidth)
|
||||
m.value = make([][]rune, minHeight, maxHeight)
|
||||
m.col = 0
|
||||
m.row = 0
|
||||
m.viewport.GotoTop()
|
||||
|
Loading…
Reference in New Issue
Block a user