aboutsummaryrefslogtreecommitdiff
path: root/lib/ui
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-05-12 00:06:09 -0400
committerDrew DeVault <sir@cmpwn.com>2019-05-12 00:06:09 -0400
commit577248f5e15d98a9a6522a605acd434059582bfc (patch)
tree890e305c723c4c21c9fba071571ee0d010be1183 /lib/ui
parentc05e5f73f29566812b7623311db8c6196c7be063 (diff)
Add initial compose widget
Diffstat (limited to 'lib/ui')
-rw-r--r--lib/ui/textinput.go5
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)),
}
}