about summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-05-12 11:21:28 -0400
committerDrew DeVault <sir@cmpwn.com>2019-05-12 11:21:28 -0400
commitf37508a53980f38c530780650338797e81fe1e3c (patch)
tree17425d8d9426a4e8a51116cc299bca7be5baab4c /lib
parent2a4dd5cb87179d8ffc00bad2552880f9bd50b75f (diff)
downloadaerc-f37508a53980f38c530780650338797e81fe1e3c.tar.gz
Implement :{next,prev}-field in compose view
Diffstat (limited to 'lib')
-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 3e1f68a..688d91d 100644
--- a/lib/ui/textinput.go
+++ b/lib/ui/textinput.go
@@ -47,9 +47,9 @@ func (ti *TextInput) Draw(ctx *Context) {
 	ti.ctx = ctx // gross
 	ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', tcell.StyleDefault)
 	ctx.Printf(0, 0, tcell.StyleDefault, "%s%s", ti.prompt, string(ti.text))
-	cells := runewidth.StringWidth(string(ti.text[:ti.index]))
-	if cells != ti.cells {
-		ctx.SetCursor(cells+1, 0)
+	cells := runewidth.StringWidth(string(ti.text[:ti.index]) + ti.prompt)
+	if cells != ti.cells && ti.focus {
+		ctx.SetCursor(cells, 0)
 	}
 }