aboutsummaryrefslogtreecommitdiff
path: root/lib/ui
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui')
-rw-r--r--lib/ui/textinput.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go
index a3127e5..2feeb84 100644
--- a/lib/ui/textinput.go
+++ b/lib/ui/textinput.go
@@ -73,16 +73,16 @@ func (ti *TextInput) Draw(ctx *Context) {
ti.ctx = ctx // gross
ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', tcell.StyleDefault)
- text := string(ti.text[scroll:])
+ text := ti.text[scroll:]
sindex := ti.index - scroll
if ti.password {
x := ctx.Printf(0, 0, tcell.StyleDefault, "%s", ti.prompt)
cells := runewidth.StringWidth(string(text))
ctx.Fill(x, 0, cells, 1, '*', tcell.StyleDefault)
} else {
- ctx.Printf(0, 0, tcell.StyleDefault, "%s%s", ti.prompt, text)
+ ctx.Printf(0, 0, tcell.StyleDefault, "%s%s", ti.prompt, string(text))
}
- cells := runewidth.StringWidth(text[:sindex] + ti.prompt)
+ cells := runewidth.StringWidth(string(text[:sindex]) + ti.prompt)
if ti.focus {
ctx.SetCursor(cells, 0)
}