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
\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
Multiple actions can be chained using \fB+\fR separator.
@@ -1929,6 +1932,14 @@ e.g.
echo "change\-header:Invalid selection"'
\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
With \fBpreview(...)\fR action, you can specify multiple different preview

View File

@@ -1435,7 +1435,7 @@ const (
func init() {
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("[,:]+")
actionNameRegexp = regexp.MustCompile("(?i)^&?[a-z-]+")
}
@@ -1892,35 +1892,35 @@ func isExecuteAction(str string) actionType {
return actTransformQuery
case "transform-search":
return actTransformSearch
case "&transform":
case "bg-transform":
return actAsyncTransform
case "&transform-list-label":
case "bg-transform-list-label":
return actAsyncTransformListLabel
case "&transform-border-label":
case "bg-transform-border-label":
return actAsyncTransformBorderLabel
case "&transform-preview-label":
case "bg-transform-preview-label":
return actAsyncTransformPreviewLabel
case "&transform-input-label":
case "bg-transform-input-label":
return actAsyncTransformInputLabel
case "&transform-header-label":
case "bg-transform-header-label":
return actAsyncTransformHeaderLabel
case "&transform-footer-label":
case "bg-transform-footer-label":
return actAsyncTransformFooterLabel
case "&transform-footer":
case "bg-transform-footer":
return actAsyncTransformFooter
case "&transform-header":
case "bg-transform-header":
return actAsyncTransformHeader
case "&transform-ghost":
case "bg-transform-ghost":
return actAsyncTransformGhost
case "&transform-nth":
case "bg-transform-nth":
return actAsyncTransformNth
case "&transform-pointer":
case "bg-transform-pointer":
return actAsyncTransformPointer
case "&transform-prompt":
case "bg-transform-prompt":
return actAsyncTransformPrompt
case "&transform-query":
case "bg-transform-query":
return actAsyncTransformQuery
case "&transform-search":
case "bg-transform-search":
return actAsyncTransformSearch
case "search":
return actSearch

View File

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