summary refs log tree commit diff stats
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)
downloadaerc-577248f5e15d98a9a6522a605acd434059582bfc.tar.gz
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)),
 	}
 }
 
rtik/mu/blame/070new-stream.subx?h=main&id=546a92985f7da2491077d641a2c118b4af7f6913'>^
33352536 ^



15b98801 ^
bc20cc3d ^
33352536 ^
6070c23e ^
33352536 ^

ca358b17 ^
33352536 ^
546a9298 ^
bc20cc3d ^
546a9298 ^
33352536 ^

bc20cc3d ^


546a9298 ^





ca358b17 ^
33352536 ^

bc20cc3d ^
33352536 ^
bc20cc3d ^


33352536 ^
bc20cc3d ^

33352536 ^
546a9298 ^
7a583220 ^
33352536 ^

bc20cc3d ^


0e9503d7 ^
bc20cc3d ^


7a583220 ^
33352536 ^

71e4f381 ^






33352536 ^
71e4f381 ^

33352536 ^

546a9298 ^



71e4f381 ^
bc20cc3d ^
546a9298 ^
bc20cc3d ^

33352536 ^
bc20cc3d ^


546a9298 ^


33352536 ^
bc20cc3d ^

33352536 ^

bc20cc3d ^


33352536 ^
546a9298 ^

bfcc0f85 ^
bc20cc3d ^
bfcc0f85 ^
bc20cc3d ^
33352536 ^
bc20cc3d ^


33352536 ^
bc20cc3d ^
546a9298 ^
71e4f381 ^
7a583220 ^
33352536 ^

bc20cc3d ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124