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

Add transform-query(...) action

Test case authored by @SpicyLemon

Close #1930
Close #2465
Close #2559
Close #2509 (e.g. fzf --bind 'space:transform-query:printf %s%s {q} {}')
This commit is contained in:
Junegunn Choi
2022-12-28 00:05:31 +09:00
parent 4dbe45640a
commit 36d2bb332b
5 changed files with 51 additions and 7 deletions

View File

@@ -890,7 +890,7 @@ const (
func init() {
executeRegexp = regexp.MustCompile(
`(?si)[:+](execute(?:-multi|-silent)?|reload|preview|change-query|change-prompt|change-preview-window|change-preview|(?:re|un)bind|pos|put)`)
`(?si)[:+](execute(?:-multi|-silent)?|reload|preview|change-query|change-prompt|change-preview-window|change-preview|(?:re|un)bind|pos|put|transform-query)`)
splitRegexp = regexp.MustCompile("[,:]+")
actionNameRegexp = regexp.MustCompile("(?i)^[a-z-]+")
}
@@ -1207,6 +1207,8 @@ func isExecuteAction(str string) actionType {
return actExecuteMulti
case "put":
return actPut
case "transform-query":
return actTransformQuery
}
return actIgnore
}