diff options
author | Koni Marti <koni.marti@gmail.com> | 2023-06-21 21:36:30 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-06-22 10:39:19 +0200 |
commit | 0fc5ffb260f764f2e7313506aa0f73ad98cbea40 (patch) | |
tree | 3e8a42552927ec105681ff2461a1b954d0993190 /lib/ui/textinput.go | |
parent | be0bfc1ae28b49be6546626ff9eaadce5464a6c8 (diff) | |
download | aerc-0fc5ffb260f764f2e7313506aa0f73ad98cbea40.tar.gz |
textinput: fix stemming with multi-byte chars
Fix a panic in the textinput when using multi-byte chars in the
completions.
Fixes: https://todo.sr.ht/~rjarry/aerc/180
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Diffstat (limited to 'lib/ui/textinput.go')
-rw-r--r-- | lib/ui/textinput.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go index b2ba33f6..e41cff75 100644 --- a/lib/ui/textinput.go +++ b/lib/ui/textinput.go @@ -144,7 +144,7 @@ func (ti *TextInput) drawPopover(ctx *Context) { }, onStem: func(stem string) { ti.Set(ti.prefix + stem + ti.StringRight()) - ti.index = len(ti.prefix + stem) + ti.index = runewidth.StringWidth(ti.prefix + stem) ti.Invalidate() }, uiConfig: ti.uiConfig, |