From b68e59a24b0bcbe84bbea2307b363d6510da3c9c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 22 May 2015 02:20:10 +0900 Subject: [PATCH] Fix ANSI offset calculation --- src/ansi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansi.go b/src/ansi.go index 126a9920..116282c1 100644 --- a/src/ansi.go +++ b/src/ansi.go @@ -50,7 +50,7 @@ func extractColor(str *string) (*string, []ansiOffset) { if !newState.equals(state) { if state != nil { // Update last offset - (&offsets[len(offsets)-1]).offset[1] = int32(output.Len()) + (&offsets[len(offsets)-1]).offset[1] = int32(utf8.RuneCount(output.Bytes())) } if newState.colored() {