mirror of https://github.com/rivo/tview.git
Text area has default size to avoid issues before first Draw. Fixes #1025
This commit is contained in:
parent
520ccd71f0
commit
1ad6daede2
|
@ -1,6 +1,7 @@
|
||||||
package tview
|
package tview
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"math"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
@ -363,6 +364,8 @@ func NewTextArea() *TextArea {
|
||||||
lastAction: taActionOther,
|
lastAction: taActionOther,
|
||||||
minCursorPrefix: minCursorPrefixDefault,
|
minCursorPrefix: minCursorPrefixDefault,
|
||||||
minCursorSuffix: minCursorSuffixDefault,
|
minCursorSuffix: minCursorSuffixDefault,
|
||||||
|
lastWidth: math.MaxInt / 2, // We need this so some functions work before the first draw.
|
||||||
|
lastHeight: 1,
|
||||||
}
|
}
|
||||||
t.editText.Grow(editBufferMinCap)
|
t.editText.Grow(editBufferMinCap)
|
||||||
t.spans[0] = textAreaSpan{previous: -1, next: 1}
|
t.spans[0] = textAreaSpan{previous: -1, next: 1}
|
||||||
|
|
Loading…
Reference in New Issue