From 5a72dc6922b51977d46d92a649f5c9ce67003bcf Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 26 Aug 2015 23:58:18 +0900 Subject: [PATCH] Fix #329 - Trim ANSI codes from output when --ansi & --with-nth are set --- src/item.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/item.go b/src/item.go index 7a0a244..2ab8a78 100644 --- a/src/item.go +++ b/src/item.go @@ -100,11 +100,11 @@ func (item *Item) AsString() string { // StringPtr returns the pointer to the original string func (item *Item) StringPtr() *string { - runes := item.text if item.origText != nil { - runes = *item.origText + trimmed, _, _ := extractColor(string(*item.origText), nil) + return &trimmed } - str := string(runes) + str := string(item.text) return &str }