From d83eb2800a09d86e17c0339d86bd1f22f68164a8 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 13 Jan 2025 00:13:31 +0900 Subject: Add change-nth action Example: # Start with --nth 1, then 2, then 3, then back to the default, 1 echo 'foo foobar foobarbaz' | fzf --bind 'space:change-nth(2|3|)' --nth 1 -q foo Close #4172 Close #3109 --- src/options.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/options.go') diff --git a/src/options.go b/src/options.go index ac4a1aca..3932cb56 100644 --- a/src/options.go +++ b/src/options.go @@ -1306,7 +1306,7 @@ const ( func init() { executeRegexp = regexp.MustCompile( - `(?si)[:+](become|execute(?:-multi|-silent)?|reload(?:-sync)?|preview|(?:change|transform)-(?:query|prompt|(?:border|list|preview|input|header)-label|header)|transform|change-(?:preview-window|preview|multi)|(?:re|un)bind|pos|put|print)`) + `(?si)[:+](become|execute(?:-multi|-silent)?|reload(?:-sync)?|preview|(?:change|transform)-(?:query|prompt|(?:border|list|preview|input|header)-label|header)|transform|change-(?:preview-window|preview|multi|nth)|(?:re|un)bind|pos|put|print)`) splitRegexp = regexp.MustCompile("[,:]+") actionNameRegexp = regexp.MustCompile("(?i)^[a-z-]+") } @@ -1684,6 +1684,8 @@ func isExecuteAction(str string) actionType { return actChangeQuery case "change-multi": return actChangeMulti + case "change-nth": + return actChangeNth case "pos": return actPosition case "execute": -- cgit v1.2.3