Fix incorrect header array mutation

This commit is contained in:
Junegunn Choi 2019-12-16 18:47:05 +09:00
parent 5da8bbf45a
commit 212de25409
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
1 changed files with 3 additions and 3 deletions

View File

@ -296,9 +296,9 @@ func Run(opts *Options, revision string) {
}
case EvtHeader:
header := value.([]string)
header = append(header, make([]string, opts.HeaderLines-len(header))...)
terminal.UpdateHeader(header)
headerPadded := make([]string, opts.HeaderLines)
copy(headerPadded, value.([]string))
terminal.UpdateHeader(headerPadded)
case EvtSearchFin:
switch val := value.(type) {