mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-09 16:42:00 -07: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:
@@ -2096,7 +2096,7 @@ func (t *Terminal) currentItem() *Item {
|
||||
func (t *Terminal) buildPlusList(template string, forcePlus bool) (bool, []*Item) {
|
||||
current := t.currentItem()
|
||||
slot, plus, query := hasPreviewFlags(template)
|
||||
if !(!slot || query && len(t.input) > 0 || (forcePlus || plus) && len(t.selected) > 0) {
|
||||
if !(!slot || query || (forcePlus || plus) && len(t.selected) > 0) {
|
||||
return current != nil, []*Item{current, current}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user