From 599e42c12b13de6af04c15e8e09c2c3984aae3e9 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sun, 30 May 2021 17:35:44 +0300 Subject: [PATCH] calculate rune widths properly in shell outputs --- ui.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui.go b/ui.go index fa9de82..54c864b 100644 --- a/ui.go +++ b/ui.go @@ -840,9 +840,9 @@ func (ui *ui) draw(nav *nav) { right := ui.cmdAccRight ui.msgWin.printLine(ui.screen, 0, 0, st, ui.cmdPrefix) ui.msgWin.print(ui.screen, len(ui.cmdPrefix), 0, st, ui.msg) - ui.msgWin.print(ui.screen, len(ui.cmdPrefix)+len(ui.msg), 0, st, string(left)) - ui.msgWin.print(ui.screen, len(ui.cmdPrefix)+len(ui.msg)+runeSliceWidth(left), 0, st, string(right)) - ui.screen.ShowCursor(ui.msgWin.x+len(ui.cmdPrefix)+len(ui.msg)+runeSliceWidth(left), ui.msgWin.y) + ui.msgWin.print(ui.screen, len(ui.cmdPrefix)+printLength(ui.msg), 0, st, string(left)) + ui.msgWin.print(ui.screen, len(ui.cmdPrefix)+printLength(ui.msg)+runeSliceWidth(left), 0, st, string(right)) + ui.screen.ShowCursor(ui.msgWin.x+len(ui.cmdPrefix)+printLength(ui.msg)+runeSliceWidth(left), ui.msgWin.y) default: pos := min(runeSliceWidth(ui.cmdAccLeft), ui.msgWin.w-len(ui.cmdPrefix)-1) left := ui.cmdAccLeft[runeSliceWidth(ui.cmdAccLeft)-pos:]