m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-14 22:33:47 -05:00

Make --accept-nth compatible with --select-1

Fix #4287
This commit is contained in:
Junegunn Choi
2025-02-26 00:24:41 +09:00
parent bb64d84ce4
commit 710ebdf9c1
4 changed files with 22 additions and 4 deletions

View File

@@ -1575,9 +1575,7 @@ func (t *Terminal) output() bool {
}
if t.acceptNth != nil {
transform = func(item *Item) string {
tokens := Tokenize(item.AsString(t.ansi), t.delimiter)
transformed := t.acceptNth(tokens, item.Index())
return StripLastDelimiter(transformed, t.delimiter)
return item.acceptNth(t.ansi, t.delimiter, t.acceptNth)
}
}
found := len(t.selected) > 0