From 85c1f8a9e09348741b8a162882e5b94f7a3e830f Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 7 Mar 2019 10:47:09 +0900 Subject: Always prepend ANSI reset code before re-assembling tokens --- src/util/chars.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/util') diff --git a/src/util/chars.go b/src/util/chars.go index 35b28297..04a66d7d 100644 --- a/src/util/chars.go +++ b/src/util/chars.go @@ -172,11 +172,11 @@ func (chars *Chars) CopyRunes(dest []rune) { return } -func (chars *Chars) Wrap(prefix string, suffix string) { +func (chars *Chars) Prepend(prefix string) { if runes := chars.optionalRunes(); runes != nil { - runes = append(append([]rune(prefix), runes...), []rune(suffix)...) + runes = append([]rune(prefix), runes...) chars.slice = *(*[]byte)(unsafe.Pointer(&runes)) } else { - chars.slice = append(append([]byte(prefix), chars.slice...), []byte(suffix)...) + chars.slice = append([]byte(prefix), chars.slice...) } } -- cgit v1.2.3