summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-08-26 23:58:18 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-08-26 23:58:18 +0900
commit5a72dc6922b51977d46d92a649f5c9ce67003bcf (patch)
treea455e4d3a9026b6ef0567e594eebaab04657e238
parent80ed02e72ee3c5d408d1b8f5a81fb43e18a87ed1 (diff)
Fix #329 - Trim ANSI codes from output when --ansi & --with-nth are set
-rw-r--r--src/item.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/item.go b/src/item.go
index 7a0a2441..2ab8a78c 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
}