Fix #329 - Trim ANSI codes from output when --ansi & --with-nth are set

This commit is contained in:
Junegunn Choi 2015-08-26 23:58:18 +09:00
parent 80ed02e72e
commit 5a72dc6922

View File

@ -100,11 +100,11 @@ func (item *Item) AsString() string {
// StringPtr returns the pointer to the original string // StringPtr returns the pointer to the original string
func (item *Item) StringPtr() *string { func (item *Item) StringPtr() *string {
runes := item.text
if item.origText != nil { if item.origText != nil {
runes = *item.origText trimmed, _, _ := extractColor(string(*item.origText), nil)
return &trimmed
} }
str := string(runes) str := string(item.text)
return &str return &str
} }