From 4aeba51ce3c7601811c6394746c4565bebc24fab Mon Sep 17 00:00:00 2001 From: stephen cheng Date: Thu, 17 May 2018 18:00:22 +1000 Subject: [PATCH] fix another broken case --- util.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/util.go b/util.go index dc50948..8ad932c 100644 --- a/util.go +++ b/util.go @@ -361,13 +361,11 @@ func printWithStyle(screen tcell.Screen, text string, x, y, maxWidth, align int, width += w start = index } - - if len(runes) > 0 { - for runewidth.RuneWidth(runes[start]) == 0 && start < len(runes) { + if len(runes) > 0 && start < len(runes) { + for runewidth.RuneWidth(runes[start]) == 0 { start++ } } - return printWithStyle(screen, substring(start, len(runes)), x+maxWidth-width, y, width, AlignLeft, style) } else if align == AlignCenter { width := runewidth.StringWidth(strippedText)