mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-17 21:43:50 -07:00
Preserve the original color of each token when using --with-nth with --ansi
Close #1500
This commit is contained in:
@@ -171,3 +171,12 @@ func (chars *Chars) CopyRunes(dest []rune) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (chars *Chars) Wrap(prefix string, suffix string) {
|
||||
if runes := chars.optionalRunes(); runes != nil {
|
||||
runes = append(append([]rune(prefix), runes...), []rune(suffix)...)
|
||||
chars.slice = *(*[]byte)(unsafe.Pointer(&runes))
|
||||
} else {
|
||||
chars.slice = append(append([]byte(prefix), chars.slice...), []byte(suffix)...)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user