m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-15 23:03:47 -05:00

Fix --header-lines unaffected by --with-nth

This commit is contained in:
Junegunn Choi
2015-07-22 21:24:02 +09:00
parent 928fccc15b
commit 4e0e03403e
3 changed files with 22 additions and 6 deletions

View File

@@ -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,