diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-05-12 11:21:28 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-05-12 11:21:28 -0400 |
commit | f37508a53980f38c530780650338797e81fe1e3c (patch) | |
tree | 17425d8d9426a4e8a51116cc299bca7be5baab4c /lib/ui | |
parent | 2a4dd5cb87179d8ffc00bad2552880f9bd50b75f (diff) |
Implement :{next,prev}-field in compose view
Diffstat (limited to 'lib/ui')
-rw-r--r-- | lib/ui/textinput.go | 6 |
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) } } |