summaryrefslogtreecommitdiffstats
path: root/src/core.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-07-22 21:24:02 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-07-22 21:24:02 +0900
commit4e0e03403e3ce1d6c0d58c02944e167a8448c792 (patch)
tree4c6501065abac191c3e446ca2e4a168298ba7109 /src/core.go
parent928fccc15baf50aafe9ecb50303089361375fb89 (diff)
Fix --header-lines unaffected by --with-nth
Diffstat (limited to 'src/core.go')
-rw-r--r--src/core.go6
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,