Rename: bg-transform
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled

This commit is contained in:
Junegunn Choi
2025-06-13 23:58:49 +09:00
parent f3babb551a
commit 276b0065b4
3 changed files with 37 additions and 26 deletions

View File

@@ -1805,6 +1805,9 @@ A key or an event can be bound to one or more of the following actions.
\fBup\fR \fIctrl\-k ctrl\-p up\fR \fBup\fR \fIctrl\-k ctrl\-p up\fR
\fByank\fR \fIctrl\-y\fR \fByank\fR \fIctrl\-y\fR
Each \fBtransform*\fR action has a corresponding \fBbg\-transform*\fR
variant that runs the command in the background.
.SS ACTION COMPOSITION .SS ACTION COMPOSITION
Multiple actions can be chained using \fB+\fR separator. Multiple actions can be chained using \fB+\fR separator.
@@ -1929,6 +1932,14 @@ e.g.
echo "change\-header:Invalid selection"' echo "change\-header:Invalid selection"'
\fR \fR
.SS TRANSFORM IN THE BACKGROUND
Transform actions are synchronous, meaning fzf becomes unresponsive while the
command runs. To avoid this, each \fBtransform\-\fR action has a corresponding
\fBbg\-transform\-\fR variant that runs in the background. Unless you need to
chain multiple transform actions where later ones depend on earlier results,
prefer using the \fBbg\fR variant.
.SS PREVIEW BINDING .SS PREVIEW BINDING
With \fBpreview(...)\fR action, you can specify multiple different preview With \fBpreview(...)\fR action, you can specify multiple different preview

View File

@@ -1435,7 +1435,7 @@ const (
func init() { func init() {
executeRegexp = regexp.MustCompile( executeRegexp = regexp.MustCompile(
`(?si)[:+](become|execute(?:-multi|-silent)?|reload(?:-sync)?|preview|(?:change|&?transform)-(?:query|prompt|(?:border|list|preview|input|header|footer)-label|header|footer|search|nth|pointer|ghost)|&?transform|change-(?:preview-window|preview|multi)|(?:re|un|toggle-)bind|pos|put|print|search)`) `(?si)[:+](become|execute(?:-multi|-silent)?|reload(?:-sync)?|preview|(?:change|transform|bg-transform)-(?:query|prompt|(?:border|list|preview|input|header|footer)-label|header|footer|search|nth|pointer|ghost)|transform|bg-transform|change-(?:preview-window|preview|multi)|(?:re|un|toggle-)bind|pos|put|print|search)`)
splitRegexp = regexp.MustCompile("[,:]+") splitRegexp = regexp.MustCompile("[,:]+")
actionNameRegexp = regexp.MustCompile("(?i)^&?[a-z-]+") actionNameRegexp = regexp.MustCompile("(?i)^&?[a-z-]+")
} }
@@ -1892,35 +1892,35 @@ func isExecuteAction(str string) actionType {
return actTransformQuery return actTransformQuery
case "transform-search": case "transform-search":
return actTransformSearch return actTransformSearch
case "&transform": case "bg-transform":
return actAsyncTransform return actAsyncTransform
case "&transform-list-label": case "bg-transform-list-label":
return actAsyncTransformListLabel return actAsyncTransformListLabel
case "&transform-border-label": case "bg-transform-border-label":
return actAsyncTransformBorderLabel return actAsyncTransformBorderLabel
case "&transform-preview-label": case "bg-transform-preview-label":
return actAsyncTransformPreviewLabel return actAsyncTransformPreviewLabel
case "&transform-input-label": case "bg-transform-input-label":
return actAsyncTransformInputLabel return actAsyncTransformInputLabel
case "&transform-header-label": case "bg-transform-header-label":
return actAsyncTransformHeaderLabel return actAsyncTransformHeaderLabel
case "&transform-footer-label": case "bg-transform-footer-label":
return actAsyncTransformFooterLabel return actAsyncTransformFooterLabel
case "&transform-footer": case "bg-transform-footer":
return actAsyncTransformFooter return actAsyncTransformFooter
case "&transform-header": case "bg-transform-header":
return actAsyncTransformHeader return actAsyncTransformHeader
case "&transform-ghost": case "bg-transform-ghost":
return actAsyncTransformGhost return actAsyncTransformGhost
case "&transform-nth": case "bg-transform-nth":
return actAsyncTransformNth return actAsyncTransformNth
case "&transform-pointer": case "bg-transform-pointer":
return actAsyncTransformPointer return actAsyncTransformPointer
case "&transform-prompt": case "bg-transform-prompt":
return actAsyncTransformPrompt return actAsyncTransformPrompt
case "&transform-query": case "bg-transform-query":
return actAsyncTransformQuery return actAsyncTransformQuery
case "&transform-search": case "bg-transform-search":
return actAsyncTransformSearch return actAsyncTransformSearch
case "search": case "search":
return actSearch return actSearch

View File

@@ -1944,16 +1944,16 @@ class TestCore < TestInteractive
time = Time.now time = Time.now
tmux.send_keys %( tmux.send_keys %(
seq 100 | #{FZF} --style full --border --preview : \ seq 100 | #{FZF} --style full --border --preview : \
--bind 'focus:&transform-header(sleep 0.5; echo th.)' \ --bind 'focus:bg-transform-header(sleep 0.5; echo th.)' \
--bind 'focus:+&transform-footer(sleep 0.5; echo tf.)' \ --bind 'focus:+bg-transform-footer(sleep 0.5; echo tf.)' \
--bind 'focus:+&transform-border-label(sleep 0.5; echo tbl.)' \ --bind 'focus:+bg-transform-border-label(sleep 0.5; echo tbl.)' \
--bind "focus:+&transform-preview-label(sleep 0.5; echo tpl.)" \ --bind "focus:+bg-transform-preview-label(sleep 0.5; echo tpl.)" \
--bind 'focus:+&transform-input-label(sleep 0.5; echo til.)' \ --bind 'focus:+bg-transform-input-label(sleep 0.5; echo til.)' \
--bind 'focus:+&transform-list-label(sleep 0.5; echo tll.)' \ --bind 'focus:+bg-transform-list-label(sleep 0.5; echo tll.)' \
--bind 'focus:+&transform-header-label(sleep 0.5; echo thl.)' \ --bind 'focus:+bg-transform-header-label(sleep 0.5; echo thl.)' \
--bind 'focus:+&transform-footer-label(sleep 0.5; echo tfl.)' \ --bind 'focus:+bg-transform-footer-label(sleep 0.5; echo tfl.)' \
--bind 'focus:+&transform-prompt(sleep 0.5; echo tp.)' \ --bind 'focus:+bg-transform-prompt(sleep 0.5; echo tp.)' \
--bind 'focus:+&transform-ghost(sleep 0.5; echo tg.)' --bind 'focus:+bg-transform-ghost(sleep 0.5; echo tg.)'
).strip, :Enter ).strip, :Enter
tmux.until do |lines| tmux.until do |lines|
assert lines.any_include?('100/100') assert lines.any_include?('100/100')