diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2019-12-16 18:47:05 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2019-12-16 18:47:05 +0900 |
commit | 212de25409636388a2a23befa847b2fa5a5d23ee (patch) | |
tree | adde8cac5a68d680b688df7c1ac868e6ce7692be /src | |
parent | 5da8bbf45af54df8f60969e88d95bf1fe155baee (diff) |
Fix incorrect header array mutation
Diffstat (limited to 'src')
-rw-r--r-- | src/core.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core.go b/src/core.go index ff558497..99dde536 100644 --- a/src/core.go +++ b/src/core.go @@ -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) { |