From 697a05cdd04781cc10cb4fb1054b7a9392a78de6 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Fri, 18 Nov 2016 22:28:55 +0300 Subject: [PATCH] handle unicode in the prompt Mentioned in #30. --- ui.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui.go b/ui.go index cd5ac6c..575ff1d 100644 --- a/ui.go +++ b/ui.go @@ -669,8 +669,8 @@ func (ui *UI) prompt(nav *Nav, pref string) string { win.printl(0, 0, fg, bg, pref) win.print(len(pref), 0, fg, bg, string(lacc)) - win.print(len(pref)+len(lacc), 0, fg, bg, string(racc)) - termbox.SetCursor(win.x+len(pref)+len(lacc), win.y) + win.print(len(pref)+runeSliceWidth(lacc), 0, fg, bg, string(racc)) + termbox.SetCursor(win.x+len(pref)+runeSliceWidth(lacc), win.y) termbox.Flush() default: // TODO: handle other events