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

Always execute preview command if {q} is in the template

Even when {q} is empty. Because, why not?

While this can be seen as a breaking change, there is an easy workaround
to keep the old behavior.

    # This will show // even when the query is empty
    : | fzf --preview 'echo /{q}/'

    # But if you don't want it,
    : | fzf --preview '[ -n {q} ] || exit; echo /{q}/'

Close #2759
This commit is contained in:
Junegunn Choi
2022-12-30 09:57:10 +09:00
parent 6c37177cf5
commit d649f5d826
4 changed files with 18 additions and 7 deletions

View File

@@ -536,7 +536,8 @@ e.g.
Note that you can escape a placeholder pattern by prepending a backslash.
Preview window will be updated even when there is no match for the current
query if any of the placeholder expressions evaluates to a non-empty string.
query if any of the placeholder expressions evaluates to a non-empty string
or \fB{q}\fR is in the command template.
Since 0.24.0, fzf can render partial preview content before the preview command
completes. ANSI escape sequence for clearing the display (\fBCSI 2 J\fR) is