diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-05-12 00:06:09 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-05-12 00:06:09 -0400 |
commit | 577248f5e15d98a9a6522a605acd434059582bfc (patch) | |
tree | 890e305c723c4c21c9fba071571ee0d010be1183 /lib | |
parent | c05e5f73f29566812b7623311db8c6196c7be063 (diff) | |
download | aerc-577248f5e15d98a9a6522a605acd434059582bfc.tar.gz |
Add initial compose widget
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ui/textinput.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go index 542a1f8..3e1f68a 100644 --- a/lib/ui/textinput.go +++ b/lib/ui/textinput.go @@ -22,10 +22,11 @@ type TextInput struct { // Creates a new TextInput. TextInputs will render a "textbox" in the entire // context they're given, and process keypresses to build a string from user // input. -func NewTextInput() *TextInput { +func NewTextInput(text string) *TextInput { return &TextInput{ cells: -1, - text: []rune{}, + text: []rune(text), + index: len([]rune(text)), } } |