diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-07-22 21:24:02 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-07-22 21:24:02 +0900 |
commit | 4e0e03403e3ce1d6c0d58c02944e167a8448c792 (patch) | |
tree | 4c6501065abac191c3e446ca2e4a168298ba7109 /src/core.go | |
parent | 928fccc15baf50aafe9ecb50303089361375fb89 (diff) |
Fix --header-lines unaffected by --with-nth
Diffstat (limited to 'src/core.go')
-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 7a0f1199..f3d0680c 100644 --- a/src/core.go +++ b/src/core.go @@ -104,13 +104,13 @@ func Run(opts *Options) { }) } else { chunkList = NewChunkList(func(data *string, index int) *Item { + tokens := Tokenize(data, opts.Delimiter) + trans := Transform(tokens, opts.WithNth) if len(header) < opts.HeaderLines { - header = append(header, *data) + header = append(header, *joinTokens(trans)) eventBox.Set(EvtHeader, header) return nil } - tokens := Tokenize(data, opts.Delimiter) - trans := Transform(tokens, opts.WithNth) item := Item{ text: joinTokens(trans), origText: data, |